我的代碼在localhost(wamp服務器)上正常工作,但在將它移動到共享主機時,出現錯誤403(禁止)。 我想這第一:403製作ajax時出現禁止的錯誤發佈請求
$.post('login.php?login', { user_email: user_email, user_password: user_password, user_remember: user_remember }, function(data)
{
// Some code here
}
然後我嘗試這樣的:
var http = new XMLHttpRequest();
var url = "login.php?login";
var params = "user_email="+user_email+"&user_password="+user_password+"&user_remember="+user_remember;
http.open("POST", url, true);
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http.onreadystatechange = function() {
if(http.readyState == 4 && http.status == 200) {
// Some code here
}
}
http.send(params);
但我仍然得到這個錯誤:
POST http://domain_name/login.php?login 403 (Forbidden)
任何想法什麼是錯?