刚写的。希望有用
$binfo =array('Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; InfoPath.2; AskTbPTV/5.17.0.25589; Alexa Toolbar)','Mozilla/5.0 (Windows NT 5.1; rv:22.0) Gecko/20100101 Firefox/22.0','Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET4.0C; Alexa Toolbar)','Mozilla/4.0(compatible; MSIE 6.0; Windows NT 5.1; SV1)',$_SERVER['HTTP_USER_AGENT']);
//218.242.124.16*
//125.90.88.*
$cip = '218.242.124.'.mt_rand(0,254);
$xip = '218.242.124.'.mt_rand(0,254);
$header = array(
'CLIENT-IP:'.$cip,
'X-FORWARDED-FOR:'.$xip,
);
function getimgs( $url,$data,$userinfo,$header)
{
$ch = curl_init();
$timeout = 5;
curl_setopt ($ch, CURLOPT_URL, "$url");
curl_setopt ($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt ($ch, CURLOPT_REFERER, "http://www.sgs.gov.cn/lz/etpsInfo.do?method=index");
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt ($ch, CURLOPT_USERAGENT, "$userinfo");
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$contents = curl_exec($ch);
curl_close($ch);
return $contents;
}
$url ='http://www.sgs.gov.cn/lz/etpsInfo.do?method=doSearch';
$u = $binfo[mt_rand(0,3)];
$data = array(
'keyWords'=>'上海科波',
'searchType'=>'1'
);
$html = (getimgs($url,$data,$u,$header));
//替换链接地址
$html = str_replace('href="#"', 'href="http://www.sgs.gov.cn/lz/etpsInfo.do?method=doSearch#"', $html);
echo $html;
?>
首先,他可能根据你的ip、agent等信息做了判断;
其次,但是却是最重要的一点,这是gov.cn的域名,建议你好好学习我国信息安全法规。
你在说的具体点