473,394 Members | 1,703 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Drop down selection to set e-mail recipient of form

Hi,

bit baffled with this but very newbie with php. I have an html form that works fine with the cgi script that our institution has provided for me to work with. What I would like however is the recipent of the form to be set by the users selection from a drop down list (if they choose "A" it goes to Mr. Brown, if they choose "B" it goes to Mrs. Smith etc).

I understand that I may need a switch statement that would set a variable depending on the selection made from the drop downlist but not sure how this would look or how the variable could then be used to set the e-mail address used which is currently set in a hidden field in the html code:

Expand|Select|Wrap|Line Numbers
  1.  
  2. <input name="recipient" type="hidden" id="recipient" value="me@here.com" />
  3.  
  4.  
Pretty sure this is fairly standard stuff but not really getting anywhere with it. Any clues?

Thanks a lot,

Si
Jan 25 '08 #1
1 2753
harshmaul
490 Expert 256MB
You want to use a select.


in the form

<select name="emails">
<option value="MrJonesathotmail.com">
MrJonesathotmail.com</option>
<option value="MrSmithathotmail.com">
MrSmithathotmail.com</option>
</select>


------------------------

in the php code that recieves this....

if (IsSet($_POST['emails']){
$Emails = $_POST['emails'];
//the variable $Emails now contains the email

}
Jan 25 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: JayB | last post by:
I am creating an online survey for one of our grants and one of the items to be answered is county (U.S.). The county is to be in a drop-down menu to prevent typos and counties from other states by...
11
by: Dan | last post by:
Hello all, I am getting records from a db and displaying the records to the user through a drop down menu in an asp page. Each record has 6 fields and I need to display them all to the user in...
5
by: SirPoonga | last post by:
I think I'd have to do a combination of ASP and javascript to do this. What I want to do fill the first drop down box with values from a database query. Then based off that selection fill in the...
2
by: kmnotes04 | last post by:
Is it possible to link one drop-down box to another? For example, if a name is chosen from a drop-down list, can another drop-down list then automatically display the person's office as a result of...
4
by: IGotYourDotNet | last post by:
I have 2 drop downs on my screen the second one is displayed and populated based on the selection of the first drop down. The problem i'm having is that when a user selects something it keeps going...
0
by: TD | last post by:
I have a combobox that is sometimes slow to drop down when clicked on. If you select an item in the list that is near the top of the list then the next time you click on the combobox it drops down...
4
by: deepee | last post by:
I have a drop down box in HTML using SELECT and OPTION tags: <select title="Choose a number" onchange="obscure()" name="Digit1" ID="Digit1"> <OPTION VALUE="">&nbsp;</OPTION> <OPTION...
2
by: ponyeyes | last post by:
Hi There, I am a bit of a newbie to PHP programming and I would like to know how I can place a selected drop down option into a PHP variable and then produce an sql query which incorporates this...
0
by: Geary | last post by:
I have a drop down list on an asp.net 2 page that is bound to a table. By default it displays the first item as the selected item. But I want to make sure that the user must change the selection. ...
3
by: amcoldspy | last post by:
Hi, am trying to create dynamic drop down boxes.. there are 3 drop down boxes. The second drop down box elements are to be update based on the selection made in the first drop down box...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.