Solved

posting a selection from a dropdown box to a variable

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to stop user from going back to a previous page in PHP 3 33
AWS EC2 & RDS Instance 5 36
tutorial for ebay api 3 35
showing loader for php/mysql/ajax live search 13 26
Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

803 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