我正在使用 Janrains PHP openID 库。一切都工作正常,除非我尝试从用户授权后返回的脚本上的查询字符串中提取值。
这是查询字符串的第一部分:
http://localhost/Cloudshare/trunk/Cloudshare/php/openID/recieve_auth_request.php? janrain_nonce=2010-11-08T22:29:59Zp9PTgs&openid.ns=http://specs.openid.net/auth/2.0&openid.mode=id_res&openid.op_endpoint=https://www.google.com/accounts/o8/ud.
我能够获取查询字符串上“janrain_nonce”项的值,但无法获取“openid.op_endpoint”等内容的任何值。
例如,
$test = $_GET["janrain_nonce"];
返回一个值 ok 到 $test 中,但是使用以下命令 $test 的值是空白...
$test = $_GET["openid.claimed_id"];
我想做的是从查询字符串中获取值之一,看看它是否包含“google”,因为我有一些特定于谷歌的处理要做。
非常感谢任何帮助。
谢谢。
I am using Janrains PHP openID library. All is working perfectly except when I try and pull values from the query string on the script that is returned to after the user is authorized.
Here is the first part of the query string:
http://localhost/Cloudshare/trunk/Cloudshare/php/openID/recieve_auth_request.php? janrain_nonce=2010-11-08T22:29:59Zp9PTgs&openid.ns=http://specs.openid.net/auth/2.0&openid.mode=id_res&openid.op_endpoint=https://www.google.com/accounts/o8/ud.
I am able to get the value of the 'janrain_nonce' item on the query string, but am not able to get any values for things like 'openid.op_endpoint'..
For example, this
$test = $_GET["janrain_nonce"];
returns a value ok into $test, but the the value of $test is blank using the following...
$test = $_GET["openid.claimed_id"];
What I am trying to do is get one of the values from the query string to see if it contains 'google' or not, as I have some processing specific to Google to do.
Any help is much appreciated.
Thanks.
发布评论
评论(1)
我在您的查询字符串中没有看到 openid.claimed_id ,但尝试获取 $_GET['openid_claimed_id'];
在我的 API 似乎表明“.”正在转换为“_”FWIW
我已经确认了这一点。 var.var2 转换为 var_var2 请参阅
http://api.fatherstorm.com/?query&test_is[]=1&test.is[]=2
I didn't see openid.claimed_id in your querystring, but try getting $_GET['openid_claimed_id'];
testing your querystring at my API seems to indicate that the "." is being converted to "_" FWIW
I've confirmed that. var.var2 gets converted to var_var2 see
http://api.fatherstorm.com/?query&test_is[]=1&test.is[]=2