Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

posting a selection from a dropdown box to a variable

Posted on 2004-08-27
3
Medium Priority
?
247 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 27

Accepted Solution

by:
Diablo84 earned 2000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

722 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