<?php
function geturl($url, $postdata="", $time=10) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5 WebMoney Advisor");
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT , $time);
curl_setopt($ch, CURLOPT_TIMEOUT , $time);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
if ($postdata){
$poststr="";
if ($postdata)
while (list($name,$value)=each($postdata)){
if (strlen($poststr)>0)
$poststr.="&";
$poststr.=$name."=".urlencode($value);
}
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $poststr);
}
$res = curl_exec($ch);
curl_close($ch);
return $res;
}
$action = array(
"to_charge"=>'4',
"recurring"=>'6',
"idUser"=>'7'
);
$cc_success = geturl("https://test.net/api/curl_test/test_cron.php", $action);
$cc_success = htmlspecialchars(mysql_escape_string(stripslashes(trim(strip_tags($cc_success)))));
//echo $cc_success;
if($cc_success == 'true'){
echo 'ok';
}
if($cc_success == 'false'){
echo 'no';
}
?>
_____________
Womans in your town