PHP Code:
650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M01/9E/1F/wKioL1mL6fyTx1ImAABB2BMgrVo215.png-wh_500x0-wm_ 3-wmp_4-s_3261250946.png "title=" 2017-08-10_130604.png "alt=" Wkiol1ml6fytx1imaabb2bmgrvo215.png-wh_50 "/>
<?php
Get UA Information
$ua = $_server[' http_user_agent ');
Storing a malicious user_agent in an array
$now _ua = Array (' FeedDemon ', ' bot/0.1 (BOT for JCE) ', ' Crawldaddy ', ' Java ', ' Feedly ', ' universalfeedparser ', ' apachebench ' ', ' Swiftbot ', ' Zmeu ', ' Indy Library ', ' obot ', ' jaunty ', ' Yandexbot ', ' Ahrefsbot ', ' Mj12bot ', ' WinHttp ', ' easouspider ', ' HttpClient ', ' Microsoft URL Control ', ' yyspider ', ' jaunty ', ' python-urllib ', ' lightdeckreports Bot ');
Prohibit empty user_agent,dedecms and other mainstream collection program are empty user_agent, some SQL injection tool is also empty user_agent
if (! $ua) {
Header ("content-type:text/html; Charset=utf-8 ");
Die (' Li Shilong original collector wood with small jj! ‘);
}else{
foreach ($now _ua as $value)
Determines whether the UA is present in the array
if (eregi ($value, $ua)) {
Header ("content-type:text/html; Charset=utf-8 ");
Die (' do not collect this site, collected wood has a small jj! ‘);
}
}
vps, that's very simple, use CURL-A simulation, such as:
650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M00/9E/21/wKiom1mL61WwIwhVAAAzztY59ec215.png-wh_500x0-wm_ 3-wmp_4-s_1631364505.png "title=" 2017-08-10_131252.png "alt=" Wkiom1ml61wwiwhvaaazzty59ec215.png-wh_50 "/>
This article from "Li Shilong" blog, declined reprint!
PHP prevents crawler settings