How does PHP authenticate with the identity verification name?

Source: Internet
Author: User

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?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.