Hi,
Helping a friend with a site and thought of a nifty idea(but can’t implement it heh…nice!).
I have a tiny bit of code in my PHP page:
[code=php]
<select name=”dog” onChange=”MM_jumpMenu(‘parent’,this,0)”>
<option value=”choosedog.php” selected>Dog Type</option>
<?php
$results = mysql_query(“SELECT * FROM dogs”);
$numresults = mysql_numrows($results);
$i=0;
while ($i < $numresults) {
$d_id=mysql_result($results,$i,”dogid”);
$dog=mysql_result($results,$i,”dogtype”);
?>
<option value=”choosedog.php?dog=<? echo $d_id ?>”><? echo $dog ?></option>
<?
++$i;
}
?>
</select>
So basically when this is selected it checks my db and outputs the list of dogs based on that type.
However, it does not keep my selection in the dropdown menu. It just goes back to ‘Dog Type’ rather than displaying(say) ‘Border Collie’ if that was the one I selected.
Do I need to use sessions to store the value in there?
Can anyone help with this problem, I’m sure it’s something simple.
Many thanks.