Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   PHP (http://www.programmingforums.org/forum29.html)
-   -   Method Post not allowd? (http://www.programmingforums.org/showthread.php?t=13944)

Kelvoron Sep 10th, 2007 5:16 PM

Method Post not allowd?
 
Hey guys i was doing some PHP, i am still rather new to it, and i was making a form i wanted it to take a name the user puts in a basic HTML form and out put it (just the first small step to a user name and pass word form). I coded it up what i thought was corectly and ran it i used the method post in the form, when i hit submit it brings up an error

Quote:

Method Not Allowed
The requested method POST is not allowed for the URL /CIS/blarg.HTML.


--------------------------------------------------------------------------------

Apache/1.3.37 Server at moronsplayingwithfire.net Port 80
This was on the host that i am renting space from. I then remembered that my first day trying out PHP i had made a user name and password form on a free host. So i looked up my old code and tested it. It worked so i copy pasted the code into a new web page on the host i am paying for and tested it. I recived the same error. With the code beeing exacly the same i know that is not the problem. Has anyone seen anything like this before? Is there a way to fix it?

by the way i use hostgator.com

Edit: I tried using Get rather then post and it din't give me the error but it did not do anything eaither just sat there

Thanks in advanced
~Kelvoron

Wizard1988 Sep 10th, 2007 5:25 PM

Posting your .php file would be helpfull.

MiKuS Sep 10th, 2007 8:00 PM

check the form action, be sure it's pointing to a php file..
<form action="file.php" method="post" name="formName">

Kelvoron Sep 10th, 2007 8:09 PM

Ok thanks. I have the PHP running inside of the acual HTML page it had worked with the free host so i figured it was ok. I will make a PHP driver when i am done working on the police departments Explorer website, and post weather it worked. thanks.

kishou Dec 14th, 2007 2:40 AM

Re: Method Post not allowd?
 
did you double check everything? also if you did and you still get your error it mght be that your hoster doesnt support PHP 4 or 5.

lynxus Dec 19th, 2007 6:04 AM

Re: Method Post not allowd?
 
The way i do things like this is to have a html file and a php file , not using php in the html file.

So in a html file you would do summat like

<form action="script.php" method="post" name="Moooo">
<input name="username" type="text"/> Username
</form>

Then in the php.

$username = $_POST['username'];

echo $username;

Sometimes i liek to use the STRreplace just to clean the username of odd chars.

$username = str_replace (" ", "_", $username);



Hope this helps in any way :)

null_ptr0 Dec 26th, 2007 10:32 AM

Re: Method Post not allowd?
 
Perhaps your host blocked it.


All times are GMT -5. The time now is 12:57 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC