Hi !

I got this function which is suppoused to POST to anoter URL, however its not working at all =(

heres the code


$url = "http://mysite.com/mscripyt.php";
$var = "a=something";

function Post($vars,$url)
{
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);
    curl_setopt($ch,CURLOPT_URL,$url);

   	curl_setopt($ch,CURLOPT_POST,true);
    curl_setopt($ch,CURLOPT_POSTFIELDS,$vars);
    $awel = curl_exec($ch);

    if($awel == false)
    {
    	echo "cookie";
    	echo "<br>".$url;
    	echo "<br>".$vars;
    }
    curl_close($ch);
    return $awel;
}

all I get is "cookie" and the parameters I used in the function, but I don't know whats wrong :/

    The page you are accessing is maybe blank or returns blank if no user agent is used.

      Write a Reply...