Solved

posting a selection from a dropdown box to a variable

Posted on 2004-08-27
3
207 Views
Last Modified: 2008-03-06
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>
0
Comment
Question by:livegirllove
  • 2
3 Comments
 
LVL 27

Accepted Solution

by:
Diablo84 earned 500 total points
ID: 11918253
on your processing page

$referedby = $_POST['clientid'];

im not 100% sure thats what you meant, if not could you elaborate further please

0
 
LVL 1

Author Comment

by:livegirllove
ID: 11918330
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.
0
 
LVL 27

Expert Comment

by:Diablo84
ID: 11918347
no problem :)

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

|)iablo
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
These days socially coordinated efforts have turned into a critical requirement for enterprises.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now