我将向php脚本发送两个参数。如果我使用浏览器运行脚本并像http://www.somewebsite.com/runScript.php?id=aaa&name=bbb一样将参数传递给它,php脚本就能正常工作。但是,当我使用Flex httpservice时,参数不会传递给脚本。
<s:HTTPService url="http://www.somewebsite.com/runScript.php"
id="verifyUserService"
result="verifyUserResult(event)"
fault="verifyUserFault(event)"
method="GET"
contentType="application/xml"
useProxy="false">
<mx:request xmlns="">
<id>
{userId}
</id>
<name>
{username}
</name>
</mx:request>
</s:HTTPService>我检查了网络监视器,参数正在发送:
POST /runScript.php HTTP/1.1 Referer: app:/AIMTSJC.swf : text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text//runScript.php;q=0.8,text/css,image/png,image/jpeg,image/gif;q=0.8,application/x激波-闪存,视频/mp4;q=0.9,futuresplash/octet;q=0.8,视频/x-flv;Q=0.7,音频/MP4,application/flash,/;q=0.5 x-flash-版本: 10,1,53,64内容-类型: application/xml内容-长度: 33用户-代理: Mozilla/5.0 (Windows;U;en-US) AppleWebKit/531.9 (KHTML,类似Gecko) AdobeAIR/2.0.2主机: www.somewebsite.com
aaabbb
回复:
HTTP/1.1 200确定日期:清华,2010年9月2日02:58:54 GMT服务器: Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.7PHP/5.2.8X-供电: PHP/5.2.10到期:清华,1981年11月19日08:52:00GMT缓存-控制:无存储,无缓存,必须重新验证,后检查=0,预检查=0 Pragma:无缓存集-Cookie: PHPSESSID=pa81b900ddff7c0b61c44c3380g3590fb;path=/ Transfer-编码:分块内容-类型: text/html
id:姓名:
我的php脚本:
// Get the id and name.
$uid= $_GET["id"];
$uname= $_GET["name"];
echo "uid: ".$uid;
echo "uname: ".$uname;我形成一个查询并发送到数据库。当我键入http://..时,查询是成功的。正如上文在浏览器URL上提到的那样。uid和uname都得到了正确的参数。但是当我运行httpservice时,uid和uname都没有参数,并且查询失败。
任何帮助都是非常感谢的!
提前谢谢你,阿布斯
发布于 2010-09-02 03:45:49
再次查看您的网络监视器输出。它实际上是通过POST发送的,所以您的$_GET将是空的:
POST /runScript.php HTTP/1.1 Referer: app:/AIMT etc....
^^^^---post, not gethttps://stackoverflow.com/questions/3623665
复制相似问题