Pergunta

I am trying to retrieve the user's email address after they have logged in with Google via openID.

The url is:

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

the php code is:

<?php
    echo $_POST["openid.ext1.value.email"];
    echo $_GET["openid.ext1.value.email"];
?>

Nothing is displayed. PHP and the get function are both working. I believe the problem is trying to get the parameters with a '.' (period). All I want is the email, so if I am doing this in an overly complicated way, I'll be happy to hear of alternatives. Thanks in advance.

Foi útil?

Solução

I would recommend you do a var_dump($_GET) to see what's getting in to your script.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top