Hello,
I know this is a basic question but I can seem to get this contact form to verify an email address. I’m trying to set it up so that the user has to enter in all the fields that’s all. Currently if all fields are filled it will send you to clrsvp.php and say thank you then redirect to the home page. If the email field is left blank then it will take you to clrsvp.php but only a blank page that wont send the email or redirect. Any help is much appreciated.
Thank you.
Here is the php:
[php]<?php
// first clean up the input values
foreach($_POST as $key => $value) {
if(ini_get(‘magic_quotes_gpc’))
$_POST[$key] = stripslashes($_POST[$key]);
$_POST[$key] = htmlspecialchars(strip_tags($_POST[$key]));
}
$ip=$_SERVER[‘REMOTE_ADDR’];
$email_to = "[email protected]";
$email_subject = “”;
$email_message .= “Name Entered: “.$_POST[“fname”].”\n”;
$email_message .= “Email: “.$_POST[“lname”].”\n”;
$email_message .= “Confirm Email: “.$_POST[“email”].”\n”;
$userEmail = filter_var( $_POST[‘email’],FILTER_VALIDATE_EMAIL );
if(!$userEmail ){
exit;
}
$email_message .= “Invitation Code: “.$_POST[“email1”].”\n”;
//email headers
$headers = 'From: '.$_POST[“email”]."\r\n".
'Reply-To: '.$_POST[“email”]."\r\n" .
‘X-Mailer: PHP/’ . phpversion();
echo (mail($email_to, $email_subject, $email_message, $headers) ? "
":“
We’re sorry, something went wrong.
”);$ip=$_SERVER[‘REMOTE_ADDR’];
$email_to = $_POST[“email”];
$email_subject = "RSVP | ";
$email_message1 = "Thank you you have RSVP’d!
Hello and welcome to !
Sincerely,
The Team
";
//email headers
$headers = 'From: '.$_POST[“email”]."\r\n".
'Reply-To: '.$_POST[“email”]."\r\n" .
‘X-Mailer: PHP/’ . phpversion();
echo (mail($email_to, $email_subject, $email_message1, $headers) ? “”:"");
die();[/php]
Here is the HTML:
[php]
Name: |
|
Email Address: |
|
Confirm Email: |
|
Invitation Code: |
|
|