我尝试通过openID登录Google后检索用户的电子邮件地址。
网址是:
00.000.000.000/loginwithgoogle.php?openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0&openid.mode=id_res&openid.op_endpoint=https%3A%2F%2Fwww .google.com%2Faccounts%2Fo8%2Fud&安培; openid.response_nonce = 2013-08-12T20%3A52%3A27ZoZizKCa486SFiQ&安培; openid.return_to = HTTP%3A%2F%2F24.255.213.250%3A50005%2Floginwithgoogle.php&安培; openid.invalidate_handle = ABSmpf6DNMw&安培; openid.assoc_handle = 1.AMlYA9XT63izbhULzG8CiL5xkIE9bfgIV6dQ_5xBjHZQjVnh4H5YRm4L2HSTRxYj&安培;和openid.signed = op_endpoint%2Cclaimed_id%2Cidentity%2Creturn_to%2Cresponse_nonce%2Cassoc_handle%2Cns.ext1%2Cext1.mode%2Cext1.type.email%2Cext1.value.email&安培; openid.sig = xK06wAKPUPdu4JVgLz0v%2F1ZTMZA%3D&安培; openid.identity = HTTPS%3A%2F%2Fwww.google.com%2Faccounts%2Fo8%2Fid%3Fid%3DAItOawm70UATPuqUjklL10scHQJGXvepPFSMI48&安培; openid.claimed_id = HTTPS%3A%2F%2Fwww.google.com%2Faccounts %2Fo8%2Fid%3Fid%3DAItOawm70UATPuqUjklL10scHQJGXvepPFSMI48&安培; openid.ns.ext1 = HTTP%3A%2F%2Fopenid.net%2Fsrv%2Fax%2F1.0&安培; openid.ext1.mode = fetch_response &安培; openid.ext1.type.email = HTTP%3A%2F%2Faxschema.org%2Fcontact%2Femail&安培; openid.ext1.value.email = myemail%40gmail.com
php代码是:
<?php
echo $_POST["openid.ext1.value.email"];
echo $_GET["openid.ext1.value.email"];
?>
没有显示任何内容。 PHP和get函数都正常工作。 我相信问题是试图用'。'来获取参数。 (期)。 我想要的只是电子邮件,所以如果我以过于复杂的方式这样做,我会很高兴听到其他选择。提前谢谢。
答案 0 :(得分:2)
我建议你做一个var_dump($ _ GET),看看你的脚本有什么用。