Commit a5330b97 by doszhang

dos

parent 33bb0630
......@@ -22,27 +22,13 @@ class IndexController extends Controller
$this->display();
}
public function wxconfig (){
get_url_content('http://dos-demo2.dev.izhida.cn/config.php'))
public function wxconfig()
{
$data = $this->http_get_data('http://dos-demo2.dev.izhida.cn/config.php');
$this->ajaxReturn(array(
'status' => 1,
'config' => $data,
'step' => 0
));
}
function get_url_content($url){
$user_agent = "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0)";
$ch = curl_init();
//curl_setopt ($ch, CURLOPT_PROXY, $proxy);
curl_setopt ($ch, CURLOPT_URL, $url);//设置要访问的IP
curl_setopt ($ch, CURLOPT_USERAGENT, $user_agent);//模拟用户使用的浏览器
@curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1 ); // 使用自动跳转
curl_setopt ($ch, CURLOPT_TIMEOUT, 60); //设置超时时间
curl_setopt ($ch, CURLOPT_AUTOREFERER, 1 ); // 自动设置Referer
curl_setopt ($ch, CURLOPT_COOKIEJAR, 'c:\cookie.txt');
curl_setopt ($ch, CURLOPT_HEADER,0); //显示返回的HEAD区域的内容
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt ($ch, CURLOPT_TIMEOUT, 10);
$result = curl_exec($ch);
curl_close($ch);
return $result;
}
}
\ No newline at end of file
......@@ -131,7 +131,7 @@ $(function(){
data : [],
async : false,
success: function(data,textStatus,jqXHR){
returnData = data;
returnData = data.config;
//console.log(returnData);
}
});//end ajax
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment