Curl and Cookies
Posted: Sun Feb 19, 2006 2:05 am
feyd | This thread was split from here.
Searching for php / curl brought me here.
Once the session cookie is got , how is it possible to send it back to access another page on the site ?
Take for example this forum.
Thanks
Searching for php / curl brought me here.
Once the session cookie is got , how is it possible to send it back to access another page on the site ?
Take for example this forum.
Code: Select all
$handle = curl_init();
curl_setopt ($handle, CURLOPT_URL, "http://forums.devnetwork.net/index.php");
.
// Set other params including username and password
.
$file_contents = curl_exec($handle); // This gets logged in
curl_setopt ($handle, CURLOPT_URL, "http://forums.devnetwork.net/privmsg.php?folder=inbox"); // Now goto another link which is a members link
// I know a redirect=somewhere.php will work in this case but Im looking to access many pages after logging in
echo $file_contents;
curl_close($handle);