我可以访问url "http://localhost:8080/test.php?dbname=zhenhuang",但以下代码不起作用。我想知道如何在javascript中调用php文件。
var http=new XMLHttpRequest();
http.onreadystatechange=function(){
console.log(http.readyState);enter code here
if(http.readyState === 4){
/*code*/
}
};
http.open("GET","http://localhost:8080/test.php?dbname=zhenhuang",true);
http.send(null);
<pre>发布于 2015-10-20 20:17:59
如果您想要获取该页面的内容,您只需:
$result = file_get_contents("http://localhost:8080/test.php?dbname=zhenhuang");阅读更多here
我希望它能有所帮助!:)
https://stackoverflow.com/questions/33227034
复制相似问题