2

I have a page that has over 100 inputs. When I post the page I'm getting error below. I did not find the source of the problem. Required phpinfo values are also below. Webserver is Apache/2.2.27 and hasn't any htaccess code.

My code style:

<form role="form" action="" method="post">

    <button type="submit" id="btnsubmit" name="btnsubmit" class="btn btn-primary">Kaydet</button>
</form> 

error page

phpinfo

eneskomur
  • 91
  • 1
  • 13
  • What permissions do you have on file? – Sakezzz Mar 02 '17 at 08:40
  • File has 0644 (rw-r--r--) permissions – eneskomur Mar 02 '17 at 08:42
  • Is http://your-site/sinav-duzenle.php accessible or does it generate the same 403 error? How do you handle POST requests in that file, do you have any place you might've forgotten to remove a `header()` or similar function call, that could generate the 403 error? What is your webserver software? Is it Apache or nginx? Doesn't it have some kind of .htaccess or global httpd.conf rule that could generate the 403 error? – Dmitry Kurilsky Mar 02 '17 at 08:55
  • Webserver is Apache. I didn't use sepecific header(). This is default post request. Mine php.ini: https://i.imgur.com/A5yfQDt.png – eneskomur Mar 02 '17 at 09:02

3 Answers3

1

There are many things that can cause this error.

  1. Your file permissions
  2. Your Apache configuration
  3. Your .htaccess

If you installed apache recently, then your case is likely to be the second. Else it would probably be your .htaccess file.

Basically you need to look for deny or require directive in your apache configuration and have something like this.

AllowOverride All
Require all granted

For more information, see this answer. Don't forget to restart apache if you change the apache config.

Community
  • 1
  • 1
Chibueze Opata
  • 9,856
  • 7
  • 42
  • 65
  • I see. I didn't have any htaccess line. But when I add your code I get 500 error all pages: https://i.imgur.com/Y6fD6uf.png – eneskomur Mar 02 '17 at 09:07
  • What version of apache are you using? If you're using 2.4 you should use a different directive. See answer link for more details – Chibueze Opata Mar 02 '17 at 10:03
  • I use Apache/2.2.27 I read answer and apply to htaccess and then I got internal server error – eneskomur Mar 02 '17 at 10:15
0
<form role="form" action="" method="post">
action="a.php" or a url 
itbirds
  • 9
  • 2
0

First of all provide submit url in your form action.

<form role="form" action="file_to_submit.php" method="post">

and change your file permission to 0655.

Run below command in terminal

chmod 655 file_to_submit.php