livegirllove
asked on
posting a selection from a dropdown box to a variable
Hi-
This code displays a dropdown box containing a list of all my current clients. I need the selected clients id number to post to $referedby.
Any ideas?
$sql = "SELECT id, name FROM results";
$res_cat = mysql_query($sql); // handle to category set
<select name="clientid">
<option value="">-</option>
<?php while ($row = mysql_fetch_assoc($res_cat )) { ?>
<option value='<?php echo $row['id']; ?>'><?php echo $row['name']; ?></option>
<?php } ?>
</select>
This code displays a dropdown box containing a list of all my current clients. I need the selected clients id number to post to $referedby.
Any ideas?
$sql = "SELECT id, name FROM results";
$res_cat = mysql_query($sql); // handle to category set
<select name="clientid">
<option value="">-</option>
<?php while ($row = mysql_fetch_assoc($res_cat
<option value='<?php echo $row['id']; ?>'><?php echo $row['name']; ?></option>
<?php } ?>
</select>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
no problem :)
we all start off somewhere, these things will become more obvious to you as you learn, good luck!
|)iablo
we all start off somewhere, these things will become more obvious to you as you learn, good luck!
|)iablo
ASKER
I'm a newbie. selectname = clientid means the selected name gets posted as clientid.
thanks for the quick response.