www.webdeveloper.com
Results 1 to 3 of 3

Thread: Post Question

  1. #1
    Join Date
    Apr 2003
    Location
    South Africa
    Posts
    220

    Post Question

    Hi,

    This post involves two questions:
    Firstly i am posting variables to an html file - receive.html - and i get this error: The requested method POST is not allowed for the URL, any ideas as to what that means?
    and secondly how would i receive those variables on the second page?

    Thanks in advance

    mdw...
    "Nothing is too true to be wonderful" - Michael Farraday (UCLA)

  2. #2
    Join Date
    Nov 2003
    Location
    Jerryville, Tejas
    Posts
    11,715
    It means what it says. The web server will not accept a POST method against that URL so you have to use GET. You can't consistently get those values to a second page without using a server side process.

  3. #3
    Join Date
    Dec 2002
    Location
    Manchester, UK
    Posts
    6,276
    The get method will pass data from form fields through the querystring whereas the post method will send the data to the server in headers that only a server-side script will be able to process. If you're not working with any server-side script (as is implied by the .html extension on your file) then you will have to use the get method as ray said.

    When information is passed through the quearystring it will appear as follows:

    http://www.url.com/path/page.html?form_field1=123&form_field2=abc

    Edit: To get the information back on the next page you'll need to parse the query string and split the string about the & symbols. That will get you some name/value pairs, then you could split them about the = symbol to separate out the name and the value. I'll write a function to do that and post it in a bit.

    Another Edit: Scratch that, I found a script that someone's already written.
    Last edited by David Harrison; 11-08-2004 at 01:56 PM.
    Every fight is a food fight when you’re a cannibal.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles