Page 1 of 1

curl problem

Posted: Fri Mar 19, 2010 2:57 pm
by rainox
I studied curl function and I tried to write a code, but it doesn't work.

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);
 
?>
 
Why doesn't it work?
Where is the problem?

Re: curl problem

Posted: Fri Mar 19, 2010 4:44 pm
by Darhazer
What exactly doesn't work. What is the expected output (there is no output in the code btw)?
So, if you want someone to help you, please write down what you are expecting and what is the real result.