----- Original Message -----
From: "cosminx2003"
--- In [email protected], <[EMAIL PROTECTED]> wrote:
>
> ----- Original Message -----
> From: "cosminx2003"
>
> Hi, i want to login on yahoo with php cURL, i made a script but i
> can't make it work fine (it gives me blank page).
> Please tell me how can i fix it.
> Thanks
>
<snip>
------------------------------------
> Hello,
> I have done this before but I used header information to
control the cookie without using cURL.
>
> Some things that don't look right to me -
>
> curl_setopt ($ch, CURLOPT_URL, 'http://login.yahoo.com/config/login?');
>
> Shouldn't the '?' be with the rest of the query string instead here -
> "?login=$username&passwd=$password&.src=&......
>
> and -
>
> &.tries=5
>
> did you copy this from a browser? will it work manually into a browser?
>
> and
>
> &.challenge=ydKtXwwZarNeRMeAufKa56.oJqaO
>
> Is some sort of session token? Has it expired?
>
------------------------------------
.tries is a hidden input.
and i think you're right .challenge is a code that changes at every
refresh
How can i fix these problems?
------------------------------------
Hello cosminx2003,
I haven't used cURL before so I will just outline
the basic principle.
Start with a plain URL that you would normally navigate to in a browser without
any POST forms being previously sent.
POST (or GET) the login details and use returned headers (or cURL) to capture
any cookies and/or session variables.
Send the cookie and session variables to the remote server in the headers along
with any necessary query string.
Then you will get the desired page that you can strip the HTML to get any
needed information.
Last time I wrote one of these types of scrips it was for a server that did not
have cURL and was running PHP version 4.x.x
I still have these scripts here but they're hard on the eyes as the connection
to the remote server was done at a raw socket level.
I can find them and send them on if you want.
Thanks, Robert