Method POST not allowed error when submitting a form.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • codyshea2000
    New Member
    • Dec 2008
    • 5

    Method POST not allowed error when submitting a form.

    this is my html /php form but every time i click submit it says
    the metod post is not alowed how can i fix this
    Code:
     <!-- Form made by cody.m -->
    <center>
     <FORM METHOD="POST" ACTION="test.php">
     <font color="red">*</font>First Name: <INPUT TYPE="text" VALUE="Joe king" SIZE="20" onFocus="this.value=''">
      
     <font color="red">*</font>E-Mail: <INPUT TYPE="text" VALUE="removed email address" SIZE="30" onFocus="this.value=''">
      
     </p>
     <center>
    <pre>Comments or feedback:</pre><TEXTAREA NAME="comment" ROWS=10 COLS=50></TEXTAREA>
     <BR>
     </center>
     <INPUT TYPE="submit">
     <INPUT TYPE="reset">
      
     </form>
      
     </center>
    <!-- END OF "Form made by cody.m" -->
    Last edited by Markus; Jan 1 '09, 03:45 PM. Reason: [code] tags
  • altonator
    New Member
    • Jan 2008
    • 15

    #2
    What says the method 'post' is not allowed? Is your web browser saying this? Or is PHP saying this? I'm guessing it's your web browser. If so, what browser are you using? Internet Explorer? Firefox? Safari? Have you tried it in a different browser?

    Your code is very old fashioned (that's the way web pages were written 5 years ago), but it should work.

    Apart from you need:
    name="give_me_a _name"
    on each of your <input tags. Otherwise you wont be able to use php to get the values that the user enters. (You'll need $_POST['name_you_gave_ it'] to get the value.)

    Also, I'd recommend getting rid of
    onFocus="this.v alue=''"
    That will probably piss people off when they try to use it.

    Comment

    • Markus
      Recognized Expert Expert
      • Jun 2007
      • 6092

      #3
      codyshea2000,

      When posting code in the forums, it is required that you wrap the code in [code] tags. You can do this by simply highlighting the code and then hitting the '#' button at the top of our editor (where you write your post). Doing this formats your code and, in return, helps our experts read it and give an answer.

      If you have any doubts, you can have a look over our Posting Guidelines to get familiar with the rules.

      Thanks,
      Moderator.

      Comment

      • Atli
        Recognized Expert Expert
        • Nov 2006
        • 5062

        #4
        codyshea2000,

        I have changed the title of this thread to better describe it's contents.
        Using phrases like "help me please!" as a thread title is not allowed.
        (See Use a good thread title for more info on how to make a good title).

        When posting in these forums, you are required to follow the Posting Guidelines.
        This is NOT optional, and failure to do so will eventually lead to a ban on your account.

        Make sure to you follow them when posting here in the future.

        Moderator

        Comment

        • altonator
          New Member
          • Jan 2008
          • 15

          #5
          Codyshea, you sent me a personal message or something? I can't find it now, but you said you were using Firefox.

          I've tried your code and it seems to work. Although there seems to be a stray </p> tag on line 8. It's not effecting anything, but you should take it out.

          Are you sure there isn't something somewhere else in your page that's causing the problem?

          Comment

          Working...