|
Posted by Trypt on 07/26/05 02:03
I got great help from here in helping me create an easy php script to
send me an email when someone fills out my contactus page. Here is the
script, and below is what I want added to it if someone could please help!
----
<?
$Name=$_POST['Name'];
$Email=$_POST['Email'];
$Comments=$_POST['Message'];
$to="contact@mywebhost.com";
$message="$Name just filled in your contact form. Message
was:\n$Message\n\nTheir E-Mail address was: $Email";
if(mail($to,"Comments From Contact Us",$message,"From: $Email\n")) {
header("Location: http://mywebhost.com/success.html");
} else {
header("Location: http://mywebhost.com/error.html");
}
?>
----
I'd like to add two more text fields under the Email portion,
respectively "phone number" and "where did you hear about us". This
seems easy, but I am confused on the output. Can I just add text to the
$message line, and add the string $phone and $source (for the two new
fields)? I have a feeling there is more coding involved then that.
But more importantly, I'd like to add two checkboxes. Basically, the
question will be "preffered method of contact?" and the boxes will be
"email" and/or "phone". Both checkboxes will be in the same line
horizontally (probably doesn't matter), and the string names will be
"boxemail" and "boxphone"
How would I setup the script to also take the information from this, and
set it up so the output makes sense?
Thanx in advance!
--
Regards from Trypt!
trypt2000@(remove)yahoo.com
Navigation:
[Reply to this message]
|