If you need to maintain a PHP session while using cURL, make sure you put the line
session_write_close();
session_write_close();
$c = curl_init();
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($c, CURLOPT_COOKIE, "PHPSESSID=".$_COOKIE['PHPSESSID']);
curl_setopt($c, CURLOPT_URL, "http://example.com/test.php");
$contents = curl_exec($c);
curl_close($c);
>> Posted in Websites at 14:03, and viewed 8,338 times
Next article: 2013 Events (02 April 2013)
Next Websites article: Custom alert and confirm functions using jQuery and CSS (14 May 2013)
Add your comments