Web Hosting Talk







View Full Version : <select> (method="get") but no get....aha..


seodevhead
12-09-2005, 05:47 PM
Okay... here is the dilemma.

I have a drop-down selection box in form tags using the method GET. It's all the US States, and each state sends a variable through GET in the URL... ie:

User selects 'California':
user is sent to URL: www.mysite.com/states.php?s=CA

Now under the list of all the states, I want a selection option to be "ALL STATES"... and if the user selects this, then I simply want them to be taken to URL:
www.mysite.com/states.php

NOT:
www.mysite.com/states.php?s=

..which is currently happening with this setup I have now. Eventhough it works, I don't want any GET variables passed in the URL.


<form action="states.php" method="get">
<p align="center"><strong>Select State:</strong>
<select name="s">
<option value="">View All States</option>....etc


Any idea how I can go about doing this??? MUCH APPRECIATION!!! Take care.

WebDesignGold
12-09-2005, 06:17 PM
Google these words: form get clean urls.

seodevhead
12-09-2005, 06:33 PM
All I am able to uncover with your suggestion is how to do Apache Mod Rewrite, which isn't what I'm really looking for.

Oras
12-10-2005, 06:56 AM
if the form just for this purpose, try the following code:
<FORM>
<p align="center"><strong>Select State:</strong><SELECT NAME=URL onchange=window.location=this.options[selectedIndex].value>
<option value="http://www.mysite.com/states.php">View All States</option>
<option value="http://www.mysite.com/states.php?s=CA">California</option>
....etc
</SELECT></p>
</FROM>
Regards