email dropdown menu
I'm trying to create a button that you push and it takes you to a page that has the following:
dropdown menu (displays emails)
and a submit button
what I want it to do is you pick an email. put a subject in and cilck the button and it sens.
this is the information I have..
that brings me to the page with the dropdown menu, subject, comments and submit button..
<input type="submit name="email">
this is that page I was mentioning..
from:<input type="text" name="email"> <br />
Subject:<textarea> </textarea> <br />
and this is the code I have been trying to figure out how to put it all together...
if anyone can help me with this that would be super! its driving me nuts!
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$formcontent="From: $name \n Message: $message";
/* <![CDATA[ */
/* ]]> */
$subject = "Contact Form";
$mailheader = "From: $email \r\n";
mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
echo "Thank You!";
Also, and this is just my dumb self talking, I didn't really get what your problem was. I got the code and read it, but you never really stated what the problem was. Anyway, hope that helps.
Originally Posted by D1Lu5IoN
my problem is that I can't get figure out how to get the dropdown menu to work with the php so it will send to the email addresses.
Oh, then that's easy. Name your SELECT tag and then put the values of the email address you want as the options.
Then in your PHP, you look for your select tag in post.
<select id="emailTo" name="emailTo">
$emailTo = $_POST['emailTo'];
that seems easy enough..
is there way to have it so when they hit the button a file is called (new page) with the drop menu and the emails on that file automatically appear in the drop down menu? so all they do is select the email fill in the blanks and push send.
I'm not sure if that makes any sense or not..
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)