public function identity() { $account = ""; // 账号 $key = ""; // 密码 $idNumber = ""; //身份证号 $name = ""; //姓名 $sign = strtoupper(md5(strtoupper(md5($idNumber . $account)) . $key));//签名 $url="https://service.sfxxrz.com/simpleCheckV4.ashx"; $querys = "idNumber=".$idNumber."&name=" .$name . "&account=" .$account. "&sign=".$sign; $curl_post = $this->curl_post($url,$querys); $data = json_decode($curl_post); $result = $data->Identifier->Result; //ResponseCode 一致 $ResponseCode = $data->ResponseCode; //100 }
public function curl_post($url , $data=array()){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); // POST数据 curl_setopt($ch, CURLOPT_POST, 1); // 把post的变量加上 curl_setopt($ch, CURLOPT_POSTFIELDS, $data); $output = curl_exec($ch); curl_close($ch); return $output; }