Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/261.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 错误\u单击按钮时出现空\u响应错误_Php_Html_Web_Xmlhttprequest_Httpresponse - Fatal编程技术网

Php 错误\u单击按钮时出现空\u响应错误

Php 错误\u单击按钮时出现空\u响应错误,php,html,web,xmlhttprequest,httpresponse,Php,Html,Web,Xmlhttprequest,Httpresponse,我有一个网站,它的所有文件(html/js/css/php)都在同一个远程主机上。我在网站上有一个按钮,单击它会向PHP文件发送一个httprequest,等待响应 我的网站几乎在任何地方都能完美运行,但有一个地方,当我连接到wi-fi时,当单击按钮时,它返回错误ERR\u EMPTY\u响应。其他按钮和PHP文件也可以工作。这只是这个特定的按钮,在这个特定的wi-fi 有人知道它为什么会发生以及如何修复吗 详情: 按钮是 onClick函数: 函数搜索(){ var param=“”; va

我有一个网站,它的所有文件(html/js/css/php)都在同一个远程主机上。我在网站上有一个按钮,单击它会向PHP文件发送一个httprequest,等待响应

我的网站几乎在任何地方都能完美运行,但有一个地方,当我连接到wi-fi时,当单击按钮时,它返回错误ERR\u EMPTY\u响应。其他按钮和PHP文件也可以工作。这只是这个特定的按钮,在这个特定的wi-fi

有人知道它为什么会发生以及如何修复吗

详情:

  • 按钮是
  • onClick函数:

    函数搜索(){
    var param=“”;
    var firstParam=true;
    var form=document.getElementById(“formCS”);
    var name=document.getElementById(“songName”).value.trim();
    如果(名称!=“”){
    firstParam=false;
    param+=“name=“+name;
    }
    var creator=document.getElementById(“creator”).value.trim();
    如果(创建者!=“”){
    if(firstParam){
    param+=“creator=”+creator;
    firstParam=false;
    }否则{
    参数+=”&creator=“+creator;
    }
    }
    var类型;
    if(document.getElementById(“partners”).checked){
    type=“合作伙伴”;
    }else if(document.getElementById(“圆圈”).选中){
    type=“圆圈”;
    }else if(document.getElementById(“行”)已选中){
    type=“行”;
    }else if(document.getElementById(“none”).checked){
    类型=”;
    }
    如果(键入!=“”){
    if(firstParam){
    param+=“type=“+type;
    firstParam=false;
    }否则{
    参数+=”&type=“+type;
    }
    }
    var year=document.getElementById(“年”).value;
    如果(年份!=“无”){
    if(firstParam){
    参数+=“年=”+年;
    }否则{
    参数+=“&year=“+year;
    }
    }
    var xhttp=newXMLHttpRequest();
    xhttp.onreadystatechange=函数(){
    如果(xhttp.readyState==4&&xhttp.status==200){
    handleResponse(xhttp.response);
    }
    };
    open(“GET”、“search.php?”+param,true);
    setRequestHeader(“内容类型”,“应用程序/x-www-form-urlencoded”);
    xhttp.send();
    }

  • php文件连接到远程主机上的数据库并运行sql查询。与网站上的其他按钮没有什么不同

  • wi-fi是由学术机构提供的免费wi-fi
  • 单击按钮后,控制台中出现错误:

明白了吗?net::ERR_EMPTY_response

如果您不提供详细信息,您希望我们如何回答?那是什么“按钮”?它会触发什么请求?您的服务器端日志文件说明了什么?该网络的具体内容是什么?你的浏览器控制台显示了什么?@arkascha喜欢什么?我可以发布所有文件中的所有代码,但它无效。你需要什么具体的细节?我不是在我的评论中写的吗?@arkascha希望这会有帮助你的浏览器控制台显示了什么?