我有一个网站一切正常。但是我只有在从php调用ajax页面时才会收到以下错误。
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p>You don't have permission to access test.php
on this server.</p>
<p>Additionally, a 404 Not Found
error was encountered while trying to use an ErrorDocument to handle the request.</p>
<hr>
<address>Apache/2.2.22 (Unix) mod_ssl/2.2.22 OpenSSL/1.0.0-fips mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 Server at salarypayroll.com Port 80</address>
</body></html>
之前工作正常,刚才面临这样的问题。问题会怎样......? 是否像服务器中的任何许可或安全问题.......?
我的功能:
function myfunc(){
var test = $("#test").val();
$.ajax({
type: 'POST',
url: 'test.php',
data:{
"test" : test,
},
success: function(data)
{
/*--------My code-------*/
}
});
}
答案 0 :(得分:0)
更改test.php文件的权限
答案 1 :(得分:0)
当test.php文件不存在或test.php文件的路径无效时,会发生此错误。
检查ajax代码中的文件路径。
答案 2 :(得分:0)
我有同样的问题。
它是由查询字符串中的特殊字符引起的。
在你的情况下可能由{inside data。
您应该检查apache重写规则。
答案 3 :(得分:0)
确保您的主机允许在表单帖子中使用http URL。一些主机部署mod_sec规则,阻止http:// url通过post传递。