Passing form choice to url ?

Status
Not open for further replies.

Porsche_maniak

Active Member
283
2009
0
40
Hi guys !
The script i want is for search box.
Long time ago the admin gave me the following script :"
<form action="search.php" method="get">
<input type="textbox" name="q" value="" /> <input class="submit" type="submit" value="Search" />"

So this opens the following url:
blablabla.com.search.php?q=TYPEDTEXT

Now i want to add an option box with values 10,20 and 30 (used for maximum showed results)

this option box must pass the choosed parameters to the url like this :

blablabla.com.search.php?q=TYPEDTEXT&res=10

I hope you can help me :)
 
4 comments
i dont understand exactly , are you looking for something lke this
<selcect name="res">
<option value="10">10</option>
<option value="20">20</option>
<option value="30">30</option>
</select>
 
Yes but how to use that?
I must get the following url when clicking the search button.

blablabla.com.search.php?q=TYPEDTEXT&res=10/20/30(depending on option box)
 
a simple demo will look like this
<html>
<head><title>Test URL</title></head>
<body>
<form action="search.php" method="get">
<input type="textbox" name="q" value="" /><br />
<select name="res">
<option value="10">10</option>
<option value="20">20</option>
<option value="30">30</option>
</select><br /><br />
<input class="submit" type="submit" value="Search" />
</form>
</body>
</html>
it will pass two strings like this
search.php?q=dd&res=10
 
Status
Not open for further replies.
Back
Top