<?php
$pathUrl="http://api.zhihuiapp.com/app/";

function GetHTTPPage($url){
//优先使用curl模式发送数据
if (function_exists('curl_init') == 1){
  $curl = curl_init();
  curl_setopt ($curl, CURLOPT_URL, $url);
  curl_setopt ($curl, CURLOPT_HEADER,0);
  curl_setopt ($curl, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt ($curl, CURLOPT_USERAGENT,$_SERVER['HTTP_USER_AGENT']);
  curl_setopt ($curl, CURLOPT_TIMEOUT,5);
  $get_content = curl_exec($curl);
  curl_close ($curl);
}else{
  require_once("snoopy.php");
  $snoopy = new snoopy();
  $snoopy->referer = 'http://www.google.com/';//伪装来源
  $snoopy->fetch($url);
  $get_content = $snoopy->results;
}
return $get_content;
//print_r($get_content);
}

function MakeUser($content){
	$obj=json_decode($content);
	if ($obj->responses!="error"){
		Global $uid,$CMobile,$CTel,$CMail,$CName,$CAddress,$CQq,$CLogo,$CTitle,$CIcp,$CUrl;
		$CMobile = $obj->CMobile;
		$CTel = $obj->CTel;
		$CMail = $obj->CMail;
		$CName = $obj->CName;
		$CAddress = $obj->CAddress;
		$CQq = $obj->CQq;
		$CLogo = $obj->CLogo;
		$CTitle = $obj->CTitle;
		$CIcp = $obj->CIcp;
		$CUrl = $obj->CUrl;
		$uid = $obj->uid;
	}else{
		echo "接口异常，请检查Config.php中用户信息配置。 errorId:".$obj->errorId;	
	}
}


?>