- 最后登录
- 2015-9-18
- 威望
- 760
- 金钱
- 398
- 贡献
- 1
- 注册时间
- 2012-11-19
- 阅读权限
- 70
- 分享
- 0
- 精华
- 13
- 积分
- 2201
- 帖子
- 180
 
TA的每日心情 | 衰 2015-9-11 23:22 |
---|
签到天数: 16 天 [LV.4]SEO旋照期
|
<?php
if(isset($_GET['action']))
{
$canshu=$_GET['action'];
}
function postUrl($url, $postvar)
{
$ch = curl_init();
$headers = array(
"POST ".$url." HTTP/1.0",
"Content-type: text/xml; charset=\"utf-8\"",
"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 = "<?xml version=\"1.0\" encoding=\"utf-8\"?>
<methodCall>
<methodName>weblogUpdates.extendedPing</methodName>
<params>
<param><value><string>7D影视资源论坛-IPTV论坛-SinmpleTV论坛</string></value></param>
<param><value><string>https://www.0371zl.com/</string></value></param>
<param><value><string>https://www.0371zl.com/thread-$canshu-1-1.html</string></value></param>
<param><value><string>https://www.0371zl.com/forum.php?mod=rss</string></value></param>
</params>
</methodCall>";
$res = postUrl('http://ping.baidu.com/ping/RPC2', $baiduXML);
if ( strpos($res, "<int>0</int>") )
{
header ("Location:https://www.0371zl.com/thread-$canshu-1-1.html");
}
else
{
header ("Location:https://www.0371zl.com/thread-$canshu-1-1.html#");
}
?>
|
|