Hey, I’ve tried to write a function that will get conntent of a web page, but it have to send cookies as well (to be loged in), I have triend the following method, but it didn’t work
[code=php]
function get_website($url)
{
$ckfile = tempnam (“/tmp”, “CURLCOOKIE”);
$handle = fopen($ckfile, “w”);
fwrite($handle, “walla.co.il TRUE / FALSE 5464605465 mydata URoles=3&Name=kirill&UName=kirill&UID=17 n walla.co.il TRUE / FALSE 5464605465 user PSW=Username&UName=pass”);
fclose($handle);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt ($ch, CURLOPT_COOKIEFILE, $ckfile);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec ($ch);
unlink($ckfile);
return $output;
}
I’m this cookeis:
[CODE]
walla.co.il TRUE / FALSE 5464605465 mydata URoles=3&Name=kirill&UName=kirill&UID=17
walla.co.il TRUE / FALSE 5464605465 user PSW=Username&UName=pass