简体   繁体   English

403禁止的错误-执行和Ajax页面

[英]403 forbidden error -executing and ajax page

I am having a website everything works fine.But i am getting the following error only when i call a ajax page page from php. 我有一个网站,一切正常。但是,仅当我从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>

It was working fine before ,just now am facing an issue like this.what would be the problem .......? 以前工作还不错,只是现在正面临这样的问题。这是什么问题。 Is it like any permission or security issue in server .......? 就像服务器.......中的任何权限或安全问题一样吗?

My function : 我的职能:

function myfunc(){
 var test = $("#test").val();  


    $.ajax({
        type: 'POST',
        url:   'test.php',
        data:{
            "test" : test,
             },
    success: function(data) 
             {
             /*--------My code-------*/

              }     

      });
}

更改test.php文件的权限

This error occurs when test.php file not exist or path to test.php file is invalid. 当test.php文件不存在或test.php文件的路径无效时,将发生此错误。

Check file path in ajax code. 检查ajax代码中的文件路径。

I have the same problems. 我有同样的问题。

It's caused by special chars in the query string. 这是由查询字符串中的特殊字符引起的。

In your case probably by the { inside data. 在您的情况下,可能由{内部数据。

You should check apache rewrite rules. 您应该检查apache重写规则。

Make sure your host allows http URL in form posts. 确保主持人在表单帖子中允许使用http URL。 Some hosts deploy a mod_sec rule which prevents http:// url passed via post. 一些主机部署了一个mod_sec规则,该规则阻止通过帖子传递http:// url。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM