Jump to content

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


Recommended Posts

Posted

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:

 

</pre><form method="post" name="Form1" action="/page">


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.

Posted (edited)

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.

print_r($_POST);

or an individual field

print_r($_POST("name"));

Edited by jamiess

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...