Page 1 of 1
solution for post method not allowed in URL
Posted: Mon Jul 26, 2010 7:26 am
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?
Re: solution for post method not allowed in URL
Posted: Mon Jul 26, 2010 8:26 am
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.
Re: solution for post method not allowed in URL
Posted: Mon Jul 26, 2010 8:46 am
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.
Re: solution for post method not allowed in URL
Posted: Mon Jul 26, 2010 8:58 am
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.
Re: solution for post method not allowed in URL
Posted: Tue Jul 27, 2010 1:48 am
by learnerabn
Thanks it works after i changed it as php file