ppypp伦理天堂,91手机在线视频,免费在线观看黄色毛片,夜夜穞天天穞狠狠穞AV美女按摩

聯(lián)系官方銷售客服

1835022288

028-61286886

投訴 已解決 怎么把新的網(wǎng)址主動通過ping提交給百度 7 0
迅睿CMS版本:4.3.12

我需要一個ping提交的功能

就是把新的網(wǎng)址主動通過ping提交給百度

這個是網(wǎng)上找到的代碼,我應該如何改造,放在哪個位置?

<?php
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>網(wǎng)站名稱</string></value></param>
<param><value><string>http://www.xxxxx.com</string></value></param>
<param><value><string>http://www.xxxxx.com/archives/879/</string></value></param>
<param><value><string>http://www.xxxxx.com/feed/</string></value></param>
</params>
</methodCall>";
$res = postUrl('http://ping.baidu.com/ping/RPC2', $baiduXML);
//下面是返回成功與否的判斷(根據(jù)百度ping的接口說明)
if (strpos($res, "<int>0</int>"))
echo "PING成功";
else
echo "PING失敗";
?>


插件版權(quán):第三方插件
插件名稱:ping提交

解決方案