Solved

posting a selection from a dropdown box to a variable

Posted on 2004-08-27
3
197 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

708 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

13 Experts available now in Live!

Get 1:1 Help Now