//发送给百度时时更新------------------------------- function ePostBaiduSitemap($id,$_urls){ $site = 'www.iqshv.com';//你的网站域名 $token = 'EwY1f8gtz3IMTn';//百度给的token $count = count($id); if (empty($count)) { printerror("未选择信息ID", "", 1, 0, 1); } $urls=array(); for($i=0;$i<$count;$i++) { $id[$i] = (int)$id[$i]; if (array_key_exists($id[$i],$_urls)){ $urls[] = $_urls[$id[$i]]; } } $api = "http://data.zz.baidu.com/urls?site=$site&token=$token"; $ch = curl_init(); $options = array( CURLOPT_URL => $api, CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_POSTFIELDS => implode("\n", $urls), CURLOPT_HTTPHEADER => array('Content-Type: text/plain'), ); curl_setopt_array($ch, $options); $result = curl_exec($ch); $httpstat = curl_getinfo($ch,CURLINFO_HTTP_CODE); curl_close($ch); if($httpstat==200){ $obj = json_decode($result); printerror("今天剩余{$obj->remain}条,成功提交{$obj->success}条", "", 1, 0, 1); }else{ printerror('推送失败', "", 1, 0, 1); } }
不行哦 麻烦楼主帮忙看下是什么原因。我的QQ 632444967 谢谢 支持楼主无私分享
|