网页自动查询是否被百度收录

@Ta 2016-04-28发布,2016-04-28修改 2151点击
@笑忘书,博客模板里那个,


<php>

    $post_href_1="{$article->Url}";        
    $url='http://www.baidu.com/s?wd='.$post_href_1;
    $curl=curl_init();
    curl_setopt($curl,CURLOPT_URL,$url);
    curl_setopt($curl,CURLOPT_RETURNTRANSFER,1);
    $rs=curl_exec($curl);
    curl_close($curl);

    if(!strpos($rs,'没有找到'))
        {    echo '<a target="_blank" title="点击查看" rel="external nofollow" href="http://www.baidu.com/s?wd=' . $article->Url . '">&nbsp;&nbsp;百度已收录</a>';}
    else
        {    echo '<a target="_blank" title="点击提交,谢谢!" rel="external nofollow" style="color:red;" href="http://zhanzhang.baidu.com/sitesubmit/index?sitename=' . $post_href_1 . '">&nbsp;&nbsp;百度未收录</a>';}         

</php>

怎么用
回复列表(5|隐藏机器人聊天)
添加新回复
回复需要登录