function postUrl($url, $postvar){
$ch = curl_init();
$headers = array("POST".$url."HTTP/1.0","Content-type: text/xml;
charset=\"gb2312\"","Accept: text/xml","Content-length: ".strlen($postvar));
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postvar);
$res = curl_exec ($ch);
curl_close ($ch);
return $res;
}
$baiduXML = "
weblogUpdates.extendedPing
脚本100
http://www.jb100.net
http://www.jb100.net/html/list-301.html
http://www.jb100.net <
/param> ";
$res = postUrl('http://ping.baidu.com/ping/RPC2', $baiduXML);
if ( strpos($res, "0 ") ){
echo "PING成功";
}else{
echo "PING失败";
}
?>
转载原文地址:http://www.jb100.net/html/content-22-581-1.html AD:真正免费,域名+虚机+企业邮箱=0元
已抢186761个
抢已抢67353个
抢已抢353275个
抢已抢667691个
抢已抢122833个
抢已抢24266个
抢