doudan1123 2015-04-15 09:18
浏览 62
已采纳

查询字符串参数丢失

This is a really weird issue which I don't know where to find the solution.

Doing a POST request I could get the request parameters from "file_get_contents('php://input')". Also the $_SERVER variable is not empty. It contains data. But $_GET is always empty regardless if parameters exist in URL or not. $_SERVER["QUERY_STRING"] is also empty with GET request method.

I don't know how to solve this. I've tried to access $_GET in strict as well as non-strict mode. Same problem always. Could there be headers missing? This is my request and response below:

Remote Address:xxx.xxx.xx.xx:80
Request URL:http://local.mysite.com/?foo=bar
Request Method:GET
Status Code:200 OK

Response Headers
Access-Control-Allow-Credentials:true
Access-Control-Allow-Methods:GET, HEAD, POST, PUT, DELETE
Connection:keep-alive
Content-Encoding:gzip
Content-Type:application/json
Date:Wed, 15 Apr 2015 09:11:51 GMT
Server:nginx/1.4.6 (Ubuntu)
Transfer-Encoding:chunked
Vary:Accept-Encoding
X-Powered-By:HHVM/3.6.0-dev

Request Headers
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Encoding:gzip, deflate, sdch
Accept-Language:sv-SE,sv;q=0.8,en-US;q=0.6,en;q=0.4,da;q=0.2,nb;q=0.2,de;q=0.2
Cache-Control:max-age=0
Connection:keep-alive
Host:local.mysite.com
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36

Query String Parameters
foo:bar
  • 写回答

1条回答 默认 最新

  • dongyinzhi4689 2015-04-15 09:28
    关注

    Is it possible that you have a rewrite rule (i.e. something similar to mod_rewrite or mod_proxy) that is not populating the GET ?

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝
  • ¥20 腾讯企业邮箱邮件可以恢复么
  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
  • ¥15 错误 LNK2001 无法解析的外部符号
  • ¥50 安装pyaudiokits失败
  • ¥15 计组这些题应该咋做呀
  • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
  • ¥15 让node服务器有自动加载文件的功能
  • ¥15 jmeter脚本回放有的是对的有的是错的
  • ¥15 r语言蛋白组学相关问题