// 接口类型:互亿无线实名认证接口
// 账户注册:https://user.ihuyi.com/register.html
// 注意事项:
// DEMO仅作参考
header("Content-type:text/html; charset=UTF-8");
function Post($curlPost,$url){
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_NOBODY, true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $curlPost);
$return_str = curl_exec($curl);
curl_close($curl);
return $return_str;
}
$account = "APPID";
$password = "APPKEY";
$app = "id2mv2";//固定值
$name = "8cc0401ce07de9a86741453d9403c025三"; //明文:张三
$id_card_no = "3601247d762ac571b3937913915939411178c9172X"; //明文:36012419960108172X
$time = time();
$password = md5($account.$password.$app.$name.$id_card_no.$time);
$target = "https://api.ihuyi.com/idcard/Submit.json";
$post_data = "account=".$account."&password=".$password."&app=".$app."&name=".$name."&id_card_no=".$id_card_no."&time=".$time;
//密码可以使用明文密码或使用32位MD5加密
$res = Post($post_data, $target);
$res_json = json_decode($res,true);
print_r($res_json);
if($res_json["code"]==2){
echo "提交成功";
}
if($res_json["result"]["status"]==2){
echo "认证通过";
}
验证码已发送到您的手机,请查收!
输入验证码后,点击“开通体验账户”按钮可立即开通体验账户。