PHP项目在本地主机中正常运行,但在远程服务器中无法正常运行

时间:2018-06-21 17:17:26

标签: javascript ajax

我无法用php找出远程服务器的新问题

这是我程序中发生问题的部分

function handleLogin(email, password, callback){
    var jsonToReturn = "";

    $.ajax(appRoot+'access/login', {
        method: "POST",
        data: {email:email, password:password}
    }).done(function(returnedData){
        if(returnedData.status === 1){
            jsonToReturn = {status:1, msg:"Authenticated..."};
        }

        else{
            //display error messages
            jsonToReturn = {status:0, msg:"Invalid email/password combination"};
        }

        typeof(callback) === "function" ? callback(jsonToReturn) : "";

    }).fail(function(){
        //set error message based on the internet connectivity of the user
        var msg = "Log in failed. Please check your internet connection and try again later.";

        //display error messages
        jsonToReturn = {status:0, msg:msg};

        typeof(callback) === "function" ? callback(jsonToReturn) : "";
    });
}

在本地服务器上工作正常,但是在远程服务器上,它调用失败功能并显示消息“登录失败。请检查您的Internet连接,然后重试。”

预先感谢

0 个答案:

没有答案