I’m trying to build a custom search form using PHP and I’m looking for a way to append a parameter to the end of the URL (based on a selection from a selection box), upon form submission.
Say I have a selection box with these values:
Red Blue Green
If I choose ‘Blue’ and submit the form, I want the URL to be:
http://customsearch.com/result/?Blue
Thank you for any help
You could (1) rewrite the submission URL dynamically from the form entries using JavaScript (as suggested by @roselan above), (2) implement rewrite rules (in .htaccess, for example) or (3) process the form field entries (via POST) on the submission page and use a simple URL redirect like this: