+ Post New Thread
Results 1 to 3 of 3
Coding Thread, HTML forms - how to get the full address/parameters when submitted? in Coding and Web Development; When a submit button on a form is clicked, the form does what it needs to with the relevant info ...
  1. #1
    dgsmith's Avatar
    Join Date
    Nov 2007
    Location
    Merseyside, England
    Posts
    927
    Thank Post
    104
    Thanked 79 Times in 68 Posts
    Rep Power
    29

    HTML forms - how to get the full address/parameters when submitted?

    When a submit button on a form is clicked, the form does what it needs to with the relevant info but is there a way to extract the link or the config it uses when submitted?

    Example:

    Code:
    <form method="post" name="Form1" action="/page">
    <input type="hidden" name="action" value="doaction"/>
    <input type="text" name="name"/>
    etc..
    the associated link of this (I think) would be http://www.site.com/page?action=doaction&name=NAMEINPUT.

    This is rather simple but what I am working with is a bit more complex with checkboxes in the form that it checks.

    I've tried to explain best I can, but really I just want to know what parameters are being passed when the submit button is clicked.

  2. IDG Tech News

  3. #2
    jamiess's Avatar
    Join Date
    Oct 2009
    Location
    Balsall Common
    Posts
    57
    Thank Post
    8
    Thanked 12 Times in 11 Posts
    Rep Power
    9
    To see the submitted values in the query string like you suggested, you need to change your form method to get. That will pass the values after the question mark. Unless you have a good reason i wouldn't recommend passing values with the query string. If your using PHP to process your form you can still see what the values are by printing out the POST Array.
    PHP Code:
    print_r($_POST); 
    or an individual field
    PHP Code:
    print_r($_POST("name")); 
    Last edited by jamiess; 11th December 2011 at 08:04 PM.

  4. #3

    glennda's Avatar
    Join Date
    Jun 2009
    Location
    The Office
    Posts
    5,422
    Thank Post
    236
    Thanked 691 Times in 624 Posts
    Rep Power
    225
    Yes as mentioned above you would need use some server side scripting. How do you want to record the data? Email, database etc?

SHARE:
+ Post New Thread

Similar Threads

  1. Replies: 3
    Last Post: 20th January 2010, 10:56 PM
  2. how to get the it department to do their actual job
    By stevenlong1985 in forum Other Stuff
    Replies: 6
    Last Post: 21st July 2009, 09:54 AM
  3. Replies: 5
    Last Post: 9th July 2006, 03:42 PM
  4. Replies: 8
    Last Post: 11th April 2006, 11:55 PM

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
  •