[prev in list] [next in list] [prev in thread] [next in thread] 

List:       curl-and-php
Subject:    Re: curl sessions
From:       Daniel Stenberg <daniel () haxx ! se>
Date:       2002-12-10 12:39:14
[Download RAW message or body]

On Mon, 9 Dec 2002, Joe Bassi wrote:

Please, don't mail me privately with curl questions. This reply is cc'ed to
the curl and php list, take follow-ups there!

See more at http://curl.haxx.se/mail/etiquette.html

> $ch = curl_init();
>
> curl_setopt($ch, CURLOPT_URL,"http://localhost/");
> curl_setopt($ch, CURLOPT_POST, 0);
> curl_setopt($ch, CURLOPT_POSTFIELDS, "command=login&username=user&password=pass");
>
> $result = curl_exec ($ch);
> curl_close ($ch);
>
> echo "Result: ".$result;
>
> This code works fine that it logs me in to the login page, but when I click
> on a link in the result page, I get a session expired error. I even tried
> it by commenting out the curl_close function, but still no luck. Is there
> any way I can keep my http session using these curl functions and be able
> to redirect to another page from the result page.

You need to understand that curl gets the HTML for you. That's basicly all.
If you output the HTML from the remote site, making it appear as if it was
your local stuff, then yes it may very well not work.

Then you need to do somthing about it.

Most likely, you should translate all URLs in the HTML to go through some
local script on your site that can perform some magic to make them work.

-- 
 Daniel Stenberg -- curl, cURL, Curl, CURL. Groks URLs.


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic