php://输入在我的服务器上是空的,但是当我在xampp上运行时不是

时间:2017-11-22 18:28:20

标签: php apache

我试图找出为什么x = std::nullopt在我的服务器(iPage)上运行时为空,但它在xampp上运行正常。我看了一些帖子,但没有找到答案。我确保没有日志错误和file_get_contents("php://input");。我也知道它不适用于allow_url_fopen=On

有人可以指出我正确的方向!

multipart/form-data
var ajax = function(object){
    var oo, xhr;
    oo = j2.extend({
        method: 'get',
        credentials: false,
        beforesend: {
            'Content-Type': 'application/x-www-form-urlencoded'
        }
    }, object);


    if("XMLHttpRequest" in window){
        xhr = new XMLHttpRequest();
    }
    else{
        xhr = new ActiveXObject("Microsoft.XMLHTTP");
    }

    xhr.onreadystatechange = function(e){
        if(xhr.readyState === 4){
            oo.complete && oo.complete(xhr);

            if(xhr.status >= 200 && xhr.status < 300){
                oo.success && oo.success(xhr);  
            }
            else if(xhr.status >= 400 && xhr.status < 600){
                oo.error && oo.error(xhr);
            }   
        }
        else if((xhr.readyState === 3) && (oo.loading)){
            oo.loading(xhr);
        }
        else if((xhr.readyState === 2) && (oo.headers)){
            oo.headers(xhr)
        }
        else if((xhr.readyState === 1) && (oo.received)){
            oo.received(xhr);
        }
    }

    xhr.open(oo.method, oo.action, true);
    xhr.withCredentials = oo.credentials;

    j2.foreach(oo.beforesend, function(v, k){
        xhr.setRequestHeader(k, v);
    });

    xhr.send(oo.data);
};
file_get_contents("php://input");

0 个答案:

没有答案