Avatar of marcodiana
Flag for United States of America asked on

requested method POST is not allowed

I have a form on an HTML page that is used to request a quote or other information from a company.  (I created this form to help out a friend who designed the site.)  The html page sends the data to a file called process.php which sends the data via email to the company.  The page works fine on my own web server (running Windows 2003) but now that it is on the company's host (Apache), I get the following error:
Method Not Allowed
The requested method POST is not allowed for the URL /quote.htm.
Apache/1.3.29 Server at www.rainguardok.com Port 80

The host service has said "Our servers do allow PHP forms. I have checked the zone files and other files related to Rain Guard. Everything looks okay from our end."

I know little about PHP and have gotten this form to work on other sites by simply modifying the fields that get passed to the process page, which are then sent in the email.  This code is working on the other sites I've used it on.  I'd appreciate any help on how to fix this problem.

Again, thanks in advance!
Apache Web ServerHTMLPHP

Avatar of undefined
Last Comment

8/22/2022 - Mon

The requested method POST is not allowed for the URL /quote.htm.

Whats quote.htm?
rename it to .php, apache can have issues with posting to .htm(l)


Sorry when I mean can have issues posting to .htm I mean

You are sending a POST request to an HTML file. Which you would get POST request not allowed. You can't send POST requests to HTML files, only GET requests.

Rename the file you are posting to, to .php

I will try your suggestion.  For clarification, quote.htm is the page with the quote request form on it.  The form has the following tag:
<FORM name="PreApp" autocomplete=off onsubmit="return ValidateOnSubmit();" action="process.php" method="post">
The process.php file takes the form data, puts it in an email, and then redirects to a thanks.html page.
Your help has saved me hundreds of hours of internet surfing.

View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Ray Paseur

@Marcodiana:  You should be posting the data to "process.php" instead of to "quote.htm" - see the <FORM tag you posted above.  In that tag, the "action=" tells the quote.htm page where to send the form data.

HTH, ~Ray

Thanks for the info.  I believed this to be an issue that could be resolved on the server by changing some settings, but did not want to force the issue with the hosting company without confirming my suspicions.

I'm confused by your comment.  If you'll look at my form tag, the "action=" DOES say "action=process.php" NOT "action=quote.htm", therefore if I understand how forms work correctly, and after several years of ASP development I think that I do, I am posting the form data to process.php and not to quote.htm.