百度收录判断实际测试没效果
问题描述
<?phpfunction getRecord(){ header("HTTP/1.1 200 OK"); header('Access-Control-Allow-Origin:*'); header("Access-Control-Allow-Headers:Origin, X-Requested-With, Content-Type, Accept"); $site = ("site:https://wxsnote.cn/253.html"); $encryption = md5(mt_rand(1655, 100860065) . time()); $baiduSite = "https://www.baidu点com/s?ie=utf-8&newi=1&mod=1&isid={$encryption}&wd={$site}&rsv_spt=1&rsv_iqid={$encryption}&issp=1&f=8&rsv_bp=1&rsv_idx=2&ie=utf-8&tn=baiduhome_pg&rsv_enter=0&rsv_dl=ib&rsv_sug3=2&rsv_sug1=1&rsv_sug7=001&rsv_n=2&rsv_btype=i&inputT=3083&rsv_sug4=3220&rsv_sug=9&rsv_sid=32818_1460_33042_33060_31660_33099_33101_32961_26350_22159&_ss=1&clist=&hsug=&f4s=1&csor=38&_cr1=32951"; $ip = mt_rand(0, 255) . '.' . mt_rand(0, 255) . '.' . mt_rand(0, 255) . '.' . mt_rand(0, 255); $header[] = "accept-encoding: gzip, deflate"; $header[] = "accept-language: en-US,en;q=0.8"; $header[] = "CLIENT-IP:" . $ip; $header[] = "X-FORWARDED-FOR:" . $ip; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $baiduSite); curl_setopt($ch, CURLOPT_HTTPHEADER, $header); curl_setopt($ch, CURLOPT_REFERER, "https://www.baidu点com/s?ie=UTF-8&wd={$site}"); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.79 Safari/537.36"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_ENCODING, 'gzip,deflate'); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); curl_setopt($ch, CURLOPT_TIMEOUT, 5); $output = curl_exec($ch); curl_close($ch); $res = str_replace([' ', "n", "r"], '', $output); if (strpos($res, "抱歉,没有找到与") || strpos($res, "找到相关结果约0个") || strpos($res, "没有找到该URL") || strpos($res, "抱歉没有找到")) {echo '<a style="color:red;font-size:12px;float:center" rel="external nofollow" title="点击提交,谢谢您!" target="_blank" href="http://zhanzhang.baidu点com/sitesubmit/index?sitename=https://wxsnote.cn/253.html"><i class="fa fa-paw fa-lx"></i> 未收录</a>'; } else {echo '<a style="color:green;font-size:12px;float: center" target="_blank" title="点击查看" rel="external nofollow" href="http://www.baidu点com/s?wd=内容"><i class="fa fa-paw fa-lx"></i> 已收录</a>'; }}?><?php echo getRecord();?>
大佬们帮忙看看
这个是用于wordpress的代码,当时是结合别人写的改的,发现不管怎样都显示己收录,挺头大的,单独拿出来也是这样
平台不让出现.用点代替啦
问题解答
回答1:平台不让出现".",使用转义试过吗?
相关文章:
1. login.html登录界面为什么和老师讲课的届而不一样?2. 微信小程序的选项卡中的数据分页加载卡顿问题???3. mysql优化 - mysql EXPLAIN之后怎么看结果进行优化 ?4. javascript - 求解答,koa-bodyparser获取到的参数是空对象,为什么?????5. html按键开关如何提交我想需要的值到数据库6. javascript - 百度echarts图表如何修改7. css3 - 如何修改mui-icon图标的大小?8. mysql - 大表和小表连接,应该注意什么,性能上9. 利用百度地图API定位及附件商家信息服务10. javascript - 页面如何获取重定向的url?