hi all

i have a drop down list to lets user to select one option
then, i want to post this option to another page and display information from my database based on this option

how can i do this?

hint: the values of the list is stored in my database

anyone can help???????

<form action="yourpostedtopage.php" method="post">
<select name="yourselectbox" id="yourselectbox">
			<option value="something1">Option 1</option>
                        <option>Option 2</option>
</select>
<input name="submitbutton" type="submit" value="submit" />
</form>

yourpostedtopage.php

...
$selectedoption = $_POST['yourselectbox'];
...
echo $selectedoption;
mysql_query(".... WHERE column = '$selectedoption' ... ")
...

something like that?

thanks for helping me in my work

Thank alot for this post it is very helpfull my project

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.