苗火 Nicholas
[php]用于跨域的简单代理
2016-5-13 萧

if(!empty($_REQUEST['obj_url'])){
$obj_url = $_REQUEST['obj_url'];
//echo $obj_url." ";

$httph = curl_init ( $obj_url );
curl_setopt ( $httph, CURLOPT_SSL_VERIFYPEER, 0 );
curl_setopt ( $httph, CURLOPT_SSL_VERIFYHOST, 2 );
curl_setopt ( $httph, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" );

curl_setopt ( $httph, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt ( $httph, CURLOPT_HEADER, 0 );
$rst = curl_exec ( $httph );
curl_close ( $httph );
echo $rst;



}

发表评论:
昵称

邮件地址 (选填)

个人主页 (选填)

内容