我有一个javascript代码,可以对php脚本进行Ajax调用。当我查看Chrome网络标签时,请求已发送,似乎没问题:
Request URL:http://localhost/site/current/inscription/ Request
Method:POST Status Code:200 OK
Accept:application/json, text/javascript, */*; q=0.01
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Connection:keep-alive
Content-Length:55
Content-Type:application/x-www-form-urlencoded
Cookie:[...]
Host:localhost
Origin:http://localhost
Referer:http://localhost/site/current/
User-Agent:Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.60 Safari/537.1
X-CSRF-Token:undefined
X-Requested-With:XMLHttpRequest
Form Data:
nomClient:bob
emailClient:bob@bob.com
但PHP脚本找不到表单数据:
if (isset($POST['emailClient']))
返回false。
当我使用GET并直接从浏览器URL栏调用它时,PHP脚本正常工作。
可能是什么问题?