Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
How to load a Name from database into an email letter?
Old 12-20-2010, 10:29 PM How to load a Name from database into an email letter?
Average Talker

Posts: 19
Trades: 0
I have an email form that is working wonderfully. I have a select box that has a list of names of people that you can email. That list is being pulled from a database.

It is currently sending to the email related to the name selected in the dropdown menu. However, in the email that sends, I would like the name of the recipient to show up in the greeting. I.E. Dear "name from dropdown".

How do I go about doing this. My select box that holds the query for the name is as folows:
PHP Code:
<?php 
echo '<select name="First_and_Last_Name">';
while( 
$array mysql_fetch_assoc($result) ) {
    
$text_for_select $array["First_Name"] . " " $array["Last_Name"]. " " $array["District"];
$value_for_select $array["Email"];
echo 
"<option></option>\n";
echo 
"<option value=\"$value_for_select\">$text_for_select</option>\n"
}
echo 
'</select>';?>
No, this is querying the First and Last Name and another variable called district in to a new variable called "text_for_select". I just want to either print the "text_for_select" after the "Dear", or better yet, just the "First_Name" and "Last_Name".

How would I get this to print there?
lazerbrains is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-25-2010, 05:58 PM Re: How to load a Name from database into an email letter?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
"Friendly names" for email headers are sent as

Code:
"John Doe<john.doe@somewhere.tld>"
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to How to load a Name from database into an email letter?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.09992 seconds with 12 queries