curl problem
Posted: Fri Mar 19, 2010 2:57 pm
I studied curl function and I tried to write a code, but it doesn't work.
example :
Why doesn't it work?
Where is the problem?
example :
Code: Select all
<?php
$ch = curl_init('http://www.example.co.il/login');
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, 'name=rainox&pass=123456');
curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookie.txt');
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
curl_exec($ch);
curl_close($ch);
?>
Where is the problem?