+ 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
    1,104
    Thank Post
    118
    Thanked 90 Times in 78 Posts
    Rep Power
    36

    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. #2
    jamiess's Avatar
    Join Date
    Oct 2009
    Location
    Balsall Common
    Posts
    72
    Thank Post
    10
    Thanked 20 Times in 17 Posts
    Rep Power
    14
    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 07:04 PM.

  3. #3

    glennda's Avatar
    Join Date
    Jun 2009
    Location
    Sussex
    Posts
    7,799
    Thank Post
    272
    Thanked 1,134 Times in 1,030 Posts
    Rep Power
    349
    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, 09: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
  •