百度收錄判斷實際測試沒效果
問題描述
<?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, "找到相關(guān)結(jié)果約0個") || strpos($res, "沒有找到該URL") || strpos($res, "抱歉沒有找到")) {echo '<a style="color:red;font-size:12px;float:center" rel="external nofollow" title="點擊提交,謝謝您!" target="_blank" ><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" ><i class="fa fa-paw fa-lx"></i> 已收錄</a>'; }}?><?php echo getRecord();?>
大佬們幫忙看看
這個是用于wordpress的代碼,當(dāng)時是結(jié)合別人寫的改的,發(fā)現(xiàn)不管怎樣都顯示己收錄,挺頭大的,單獨拿出來也是這樣
平臺不讓出現(xiàn).用點代替啦
問題解答
回答1:平臺不讓出現(xiàn)".",使用轉(zhuǎn)義試過嗎?
相關(guān)文章:
1. javascript - 百度echarts series數(shù)據(jù)更新問題2. java - 我設(shè)置了cookie的max age,但是cookie依然在關(guān)閉游覽器后消失了3. python小白的基礎(chǔ)問題 關(guān)于while循環(huán)的嵌套4. php自學(xué)從哪里開始?5. MySQL客戶端吃掉了SQL注解?6. css3 - [CSS] 動畫效果 3D翻轉(zhuǎn)bug7. java固定鍵值轉(zhuǎn)換,使用枚舉實現(xiàn)字典?8. 求大神幫我看看是哪里寫錯了 感謝細(xì)心解答9. phpstady在win10上運行10. javascript - JS設(shè)置Video視頻對象的currentTime時出現(xiàn)了問題,IE,Edge,火狐,都可以設(shè)置,反而chrom卻...
