I have a strange issue where I have the following form/php form handler:
<form id="search" method="get" action="page.php?pg=xxxxxx">
On submit, in the url I get domain.com/page.pgp?action=xxxx....(more get parameters here). How can I pass the pg=xxxx into the action url correctly? I tried throwing an & sign (page.php?pg=xxxxxx&) but that didn't seem to work either.
2 Answers 2
You are passing the pg value of "xxxxxx" incorrectly. These values should be passed in the input tags inside the form, for instance:
<form id="search" method="get" action="page.php>
<input type="hidden" name="pg" value="xxxxxx">
<input name="submit" value="Submit">
</form>
the previous code creates a form with a button called "Submit", and when you press it, it takes you to your page action.php with the query string you wanted in the url:
Hope that helps! :)
4 Comments
Add a hidden input to your form instead:
<input type="hidden" name="pg" value="xxxxxx" />