Get Method Works but not Post Method on PHP 5.0.4 pages

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I am unable to display PHP pages generated by a submission of a form
using a POST method.  To illustrate this, I created a very simple form
called TestForm.php .

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
" ">
<html xmlns=" ">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"
<title>Test Form</title>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<tr><td>Name</td><td><input type="text" name="name0"/></td></tr>
<tr><td>Age</td><td><input type="text" name="age0"/></td></tr>
<input type="submit" name="SubmitMe" value="Submitted" />

I first set the method for the form to GET and the page loaded again
after the submit.
When I changed the method back to POST, I received a Page Not Found
error page.
I created another page testform3.php to display the Form Values after
submit.  I changed the action on the form to testform3.php.

I am frustrated.
Windows 2k Server SP4
PHP 5.04
MySQL 4.1.11

Any and all help would be appreciated.


Re: Get Method Works but not Post Method on PHP 5.0.4 pages

I don't understand your problem, your code works for me (with GET as
well as with POST methods), the page loads again after submitting.

mickbw wrote:
Quoted text here. Click to load it

Re: Get Method Works but not Post Method on PHP 5.0.4 pages

Thanks for the Reply.

I know it should work.  It works if I test it on my workstation or on
another server.  The problem is that even a simple page like this is
not working on a Win2k Server with PHP 5.04 and IIS 5.0 installed on

I'm sure it is a setting that I've missed but I'm not seeing it.


Re: Get Method Works but not Post Method on PHP 5.0.4 pages

Quoted text here. Click to load it

 Then it's probably a setting in IIS, not in PHP, in which case try:


< Space: disk usage analysis tool

Re: Get Method Works but not Post Method on PHP 5.0.4 pages


Thanks.  It was IIS.

A post at PHPBuilder sent me this info:
Running Win2K AS + IIS5.0 + PHP 4.3.1, I ran into a nasty problem that
I mistakenly thought had to do with something in the php.ini
configuration. When I would try to submit a form using the HTTP method
GET it would work, but I would get a "404 Page Not Found" error using
the POST method.

All my permissions were set correctly, the php.ini was configured
correctly. It had to do with URLScan being installed on IIS (see below)

Page 404 File Not Found Error When Using POST method in PHP (and Perl,
and otherwise)

This is related to the Microsoft URLScan utility. If you have this
problem, the IIS administrator has probably run the IIS Lockdown tool
as well as configured URLScan to reject this type of HTTP method when
sent in a URL. These tools are meant to enhance web server security.

URLScan configuration files can be found in the
\WINNT\system32\inetsrv\urlscan folder on the web server. Specifically,
the file to modify is urlscan.ini.

The changes to make are as follows:
1. Make sure UseAllowVerbs=1 under [options]
2. Under the [AllowVerbs] section, list your allowed HTTP methods to

For more information on the IIS Lockdown tool and URLScan, visit">

It works now.

Site Timeline