Link to home
Start Free TrialLog in
Avatar of livegirllove
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>
ASKER CERTIFIED SOLUTION
Avatar of Diablo84
Diablo84

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of livegirllove
livegirllove

ASKER

Exactly what I needed.  I wasn't thinking clearly ;-)  
I'm a newbie.  selectname = clientid means the selected name gets posted as clientid.  

thanks for the quick response.
no problem :)

we all start off somewhere, these things will become more obvious to you as you learn, good luck!

|)iablo