时间:2021-07-01 10:21:17 帮助过:19人阅读
index.php里:
var request = new XMLHttpRequest();
request.open("POST","test.php");
request.setRequestHeader("Content-type","application/x-www-form-urlencoded");
var str="name="+url;
request.send(str);
text.php里:
$url=$_POST['name'];
echo $url;
两个文件在同一工程下,url是个变量,text.php执行会提示undefined index:name
readyState=4 Status=0 ,请问哪儿出错了