调整查询字符串中的变量



在我的API访问文件中,我有以下代码

//operation was successful get the token from the reponse.
$challengeToken = $r->result->token;
    // to this point, we have got the token 
$userAccessKey = 'jkdijakjiejkdj25';    
//generate key
$generatedKey = md5($challengeToken.$userAccessKey);

我使用http_request2类通过声明来发送post数据

$loginrequest = new HTTP_Request2('http://vijayholdings.com/admin/webservice.php?operation=login&username=admin&accessKey=('.$generatedKey.')', HTTP_Request2::METHOD_POST);

有人能告诉我如何在作为类参数提供的URL中包含$generatedKey吗?

目前

$loginrequest = new HTTP_Request2('http://vijayholdings.com/admin/webservice.php?operation=login&username=admin&accessKey=$generatedKey', HTTP_Request2::METHOD_POST);

我也试过,但失败了。。。

请指导我

语法分析器只需使用双引号" "即可获取"$variables"

最新更新