cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Downloading page in PHP database

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sun, 28 Jul 2002 19:45:43 +0200 (MET DST)

On Mon, 15 Jul 2002, Raphael Summers wrote:

> I apologise in advance for presenting what I believe is a standard problem.
> Unfortunately, time does not permit me at the moment to research into it. I
> was wondering whether you might know the answer.
>
> I am trying to download the html of the following website:
>
> http://www.idlepimps.com/displaycityranks.php?offset=0&uid=3w6FZJiZmXzH
>
> However, it downloads (null).
>
> The website www.idlepimps.com presents two boxes for username and password.
> After a bit of investigation, I discovered that the following website
> achieves the same goal:
>
> http://www.idlepimps.com/login.php?pimpid=xxx&pwd=xxx
>
> Another observation I made is that the uid changes on every occassion I log
> in. Therefore, it did not seem possible just to use the CURLOPT_POSTFIELDS
> option of curl_easy_setopt() with uid=3w6FZJiZmXzH. I also messed around a
> bit with CURLOPT_USERPWD, but to no avail. How do I get Curl to log onto
> www.idlepimps.com, retrieve the new uid, and then use that uid to download
> the webpage I require?

You need to make the same operations using curl, that you and your browser
does to login.

You probably need to login to some page first, which probably sends you back
that uid and possibly some cookies and whatever, so you extract those and use
them in your second request for what you really wanted.

-- 
  Daniel Stenberg -- curl groks URLs
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Received on 2002-07-28