Thanks so much for your help.
The email is generating fine, but I would like to be able to include the information the user enters into the form in the email for their records. How would I do that?
Code:
<?php
if(($_POST['college']=="")||($_POST['streetaddress']=="")||($_POST['city']=="")||($_POST['zip']=="")||($_POST['state']=="")||($_POST['contactperson']=="")||($_POST['contactemail']=="")||($_POST['phone']=="")||($_POST['fax']==""))
{
echo "<html><body><p>The following fields are <strong>required</strong>.</p><ul>";
if($_POST['college'] == ""){ echo "<li>*College</li>"; }
if($_POST['streetaddress'] == ""){ echo "<li>*Street Address</li>"; }
if($_POST['city'] == ""){ echo "<li>*City</li>"; }
if($_POST['zip'] == ""){ echo "<li>*Zip</li>"; }
if($_POST['state'] == ""){ echo "<li>*State</li>"; }
if($_POST['contactperson'] == ""){ echo "<li>*Contact Person</li>"; }
if($_POST['contactemail'] == ""){ echo "<li>*Contact Email</li>"; }
if($_POST['phone'] == ""){ echo "<li>*Phone</li>"; }
echo "</ul><p>Please use your browsers <a href=\"javascript:history.back();\">Back</a> button and fill out these fields.</p></body></html>";
}
if(isset($_POST['submit'])) {
$to = "my@email.com";
$subject = "Contact Has Registered";
$college = $_POST['college'];
$streetaddress = $_POST['streetaddress'];
$city = $_POST['city'];
$state = $_POST['date'];
$contactperson = $_POST['contactperson'];
$contactemail = $_POST['contactemail'];
$phone = $_POST['phone'];
$body = "From: $college
Street Address: $streetaddress
E-Mail: $contactemail
Phone Number: $phone
Contact Email: $contactemail
Message: $message_field";
echo "We've recived your contact information $to! We will be in Contact with you shortly!" ;
mail($to, $subject, $body);
//These are the variables for the email
$sendto = $_POST['contactemail']; // this is the email address collected form the form
$ccto = "my@email.com"; //you can cc it to yourself
$subject = "Registration"; // Subject
$message = "Thank you for registering with...";
$header = "From: my@email.com\r\n";
// This is the function to send the email
if(mail($sendto, $subject, $message, $header)) header("location: attendee.html");
}
?>
<script type=text/javascript>
setTimeout("location.href='index.html'", [3000]);
</script>
Bookmarks