[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;
		
		
		
	}
	

标签: php

发表评论:

Powered by anycle 湘ICP备15001973号-1