百度站长平台php的主动提交源码是:
$urls = array( 'http://www.quyuexuan.com/article/31', ); $api = 'http://data.zz.baidu.com/urls?site=www.quyuexuan.com&token=Ka5ezP4FdBTLx8fr'; $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); echo $result;
如果根目录放个baidu.php文件,该怎么写代码调用最新的内容配合提交代码,我只需浏览器浏览这个文件就实现主动提交呢?