简体   繁体   中英

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.

<!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.

Check file path in ajax code.

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.

Make sure your host allows http URL in form posts. Some hosts deploy a mod_sec rule which prevents http:// url passed via post.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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