Hi,
I'm trying to auto login to a website(created by me ;-) ) using the curl. as I am new to this I don't know how to make this possible.
following is the code I tried but this is not submitting the data in the other site. the 'usr_name' and 'password' the field names in the page "http://localhost/myproject/users/login". and I have given a print_r in that site and it is displaying
Array ( [loginType] => L [step] => confirmation [usr_name] => dasd@hotmail.com [password] => test123 )
but not submitting the form.
please help me....
this is the code i've tried..I got this from web...
$login = "http://localhost/myproject/users/login";
$param="loginType=L&step=confirmation&usr_name=dasd@hotmail.com&password=test123";
$c = curl_init();
curl_setopt($c, CURLOPT_URL, $login);
curl_setopt($c, CURLOPT_COOKIEJAR, "cookies.txt");
curl_setopt($c, CURLOPT_COOKIEFILE, "cookies.txt");
curl_setopt($c, CURLOPT_POST, 1);
curl_setopt($c, CURLOPT_POSTFIELDS, $param);
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($c, CURLOPT_FOLLOWLOCATION, 1);
echo curl_exec($c);
thanks in advance....