Tag: Exec Interface name failed class returned reason version ati
PHP-based Authentication name authentication interface Call code instance, ID card authentication interface application: https://www.juhe.cn/docs/api/id/103
<!--?PHP// +----------------------------------------------------------------------// | juhephp [No ZUO no die]//+----------------------------------------------------------------------//| Copyright (c) 2010-2015 http://juhe.cn All rights reserved.//+------------------------------------------------------ ----------------// | Author:juhedata <[email protected]>//+-------------------------------------------------------------------- --//----------------------------------//ID Authentication-aggregated data//online interface documentation: http://www.juhe.cn/docs/103//-------------------- -------------- Header(' Content-type:text/html;charset=utf-8 '); //Configure the Appkey you requested$appkey= "*********************"; //************1. Real name and ID number are judged by the same ************$url= "Http://op.juhe.cn/idcard/query";$params=Array( "Idcard" = "3303291989********",//ID Number"Realname" = "East good-looking",//real name"Key" =$appkey,//Application Appkey (Application Detail page query));$paramstring=Http_build_query($params);$content= Juhecurl ($url,$paramstring);$result= Json_decode ($content,true);if($result){ if($result[' Error_code ']== ' 0 '){ if($result[' Result '] [' res '] = = ' 1 '){ Echo"Identity card number and real name match"; }Else{ Echo"The identity card number is inconsistent with the real name"; } #Print_r ($result);}Else{ Echo $result[' Error_code ']. ":".$result[' Reason ']; }}Else{ Echo"Request Failed";}//************************************************** /** * Request interface to return content * @param string $url [requested URL address] * @param string $params [parameter requested] * @param int $ipost [if post] * @re Turn string*/functionJuhecurl ($url,$params=false,$ispost=0){ $httpInfo=Array(); $ch=Curl_init (); curl_setopt ($ch, Curlopt_http_version,curl_http_version_1_1); curl_setopt ($ch, Curlopt_useragent, ' Juhedata ' ); curl_setopt ($ch, Curlopt_connecttimeout, 60 ); curl_setopt ($ch, Curlopt_timeout, 60); curl_setopt ($ch, Curlopt_returntransfer,true ); curl_setopt ($ch, Curlopt_followlocation,true); if($ispost) {curl_setopt ($ch, Curlopt_post,true ); curl_setopt ($ch, Curlopt_postfields,$params ); curl_setopt ($ch, Curlopt_url,$url ); } Else { if($params) {curl_setopt ($ch, Curlopt_url,$url.‘?‘.$params ); }Else{curl_setopt ($ch, Curlopt_url,$url); } } $response= Curl_exec ($ch ); if($response===FALSE) { //echo "CURL Error:". Curl_error ($ch); return false; } $httpCode= Curl_getinfo ($ch,Curlinfo_http_code); $httpInfo=Array_merge($httpInfo, Curl_getinfo ($ch ) ); Curl_close ($ch ); return $response;}
How does PHP authenticate with the identity verification name?