我试图找出为什么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");