Hi
I am using the following curl code to post into a ASPX url. When I do the execute, curl is posting and getting the result more than once. I am not sure why. Can anyone help me on this.
[php]
<?php
$ch = curl_init();
$POSTFIELDS = "UserName=test&Password=testpapi&Name=geek";
$LOGINURL= "http://localhost/fun.aspx";
curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 0);
curl_setopt($ch,CURLOPT_URL,$LOGINURL);
curl_setopt($ch,CURLOPT_POST,1);
curl_setopt($ch,CURLOPT_POSTFIELDS,$POSTFIELDS);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
@extract($_REQUEST)
if($result = curl_exec($ch))
{
echo "<pre>".$result."</pre>";
curl_close($ch);
unset($ch);
exit;
}
echo $result;
?>[/php]
Please read the Posting Guidelines before you post in this forum!.
Especially the part about enclosing code within php or code tags.
moderator