<?php
error_reporting(E_ALL^E_NOTICE^E_WARNING);//禁用错误报告
$host = 'http://li71.com';
$str = $_SERVER["QUERY_STRING"];
$urlc = substr($str,strrpos($str,":80/")+3);
//echo $str;
//if(strpos($urls,'www') === false){
include_once 'include/company_info.php';
if(is_mobile_request()==1){
$url='http://li71.com/skinm/'.$skinm.'/'.$urlc.'';
}else{
$url='http://li71.com/skinw/'.$skinw.'/'.$urlc.'';
}
//var_dump($url);die;
$data=array('cid'=>$cid);
$html = curlPost($url,$data,'POST');
echo $html;die;
//}
function curlPost($url,$data='',$method){
$ch = curl_init(); //1.初始化
curl_setopt($ch, CURLOPT_URL, $url); //2.请求地址
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);//3.请求方式
if($method=="POST"){//5.post方式的时候添加数据
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
}
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$tmpInfo = curl_exec($ch);//6.执行
if (curl_errno($ch)) {//7.如果出错
return curl_error($ch);
}
curl_close($ch);//8.关闭
return $tmpInfo;
}
?>