Hi,
Thanks for your Help for CURL. I am now facing another problem in it. I want to login on another site. The other site redirect the page and use session for navigation. But my code does not redirect the page.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"http://techbuys.com/adminsite/index.php");
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 3); //times out after 4s
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "txtLogin=login&txtNickName=test&txtPassword=test");
$result=curl_exec ($ch);
curl_close ($ch);
echo ($result);
Well i have written the above code on my www.mydomain.com and the site www.techbuys.com/adminsite/index.php call itself index page after form post and then after processing the form redirect the user to main.php page. Please let me know how can i overcome this problem.
Regards,
Imran Khalid
imranlink@hotmail.com
wazirabad@yahoo.com