solution for post method not allowed in URL

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
learnerabn
Forum Commoner
Posts: 48
Joined: Wed Feb 10, 2010 12:56 am

solution for post method not allowed in URL

Post by learnerabn »

i am developing a site in which i have quiz page.After submitting the page the page with answer should display.But i am having an error msg that POST method not allowed for URL exampl\quiz.html
But it was properly running in my localhost the problem occurs only in online.

Can any body help me?
buckit
Forum Contributor
Posts: 169
Joined: Fri Jan 01, 2010 10:21 am

Re: solution for post method not allowed in URL

Post by buckit »

that because you are trying to use PHP in a html file. The web server has no idea what to do with $_POST in quiz.html because its processing it as an HTML file. Change quiz.html to quiz.php and you should be OK baring any other issues.
learnerabn
Forum Commoner
Posts: 48
Joined: Wed Feb 10, 2010 12:56 am

Re: solution for post method not allowed in URL

Post by learnerabn »

that because you are trying to use PHP in a html file. The web server has no idea what to do with $_POST in quiz.html because its processing it as an HTML file. Change quiz.html to quiz.php and you should be OK baring any other issues.
if that is the case it should not run in run in localhost na...but it is running in localhost.
More than that it is not php file it is a ASP.net file i'm trying to convert it in php.
buckit
Forum Contributor
Posts: 169
Joined: Fri Jan 01, 2010 10:21 am

Re: solution for post method not allowed in URL

Post by buckit »

There are many ways to configure a web server. Your localhost is probably setup to execute html as a script.

you have to choose what you are going to do.

.html - you only have html in your file
.php - you are executing PHP scripts such as $_POST
.aspx - you are executing asp.net scripts

you cant mix and match php and asp. you also dont want to execute scripts in html files.
learnerabn
Forum Commoner
Posts: 48
Joined: Wed Feb 10, 2010 12:56 am

Re: solution for post method not allowed in URL

Post by learnerabn »

Thanks it works after i changed it as php file
Post Reply