Hello,
I have a self processing form that draws and email address from another page... When the form processes and error checks for empty fields the page reloads but that email is lost to the form will redirect but never send does any one know how to fix this?? here is the url http://www.sprayfluxing.com/contact/contact2.php click on the email link for any person listed. Also here is the self processing form php code
<?PHP
session_start();
@extract($_POST);
//pull from contact list page
$emailaddy = $_POST['emailaddy'];
$emailaddy2 = $_POST['emailaddy2'];
$emailaddy3 = $_POST['emailaddy3'];
$emailaddy4 = $_POST['emailaddy4'];
$emailaddy5 = $_POST['emailaddy5'];
$emailaddy6 = $_POST['emailaddy6'];
$emailaddy7 = $_POST['emailaddy7'];
//variables to send email
$sendto = $_POST['sendto'];
$subject = "Spray Fluxing.com Contact Form Submission";
$emailsubject = $_POST['emailsubject'];
$name = $_POST['name'];
$email = $_POST['email'];
$comments = $_POST['comments'];
$body = "Name: $name\nEmail: $email\nSubject: $emailsubject\nComments:\n$comments\n";
$nameerror = "";
$emailerror = "";
$validerror = "";
//display who email is going to
if ($_POST['emailaddy']) {
$emailvalue = 'asousa@sono-tek.com';
$toheader = 'Steve Harshbarger';
}
if ($_POST['emailaddy2']) {
$emailvalue = 'asousa@sono-tek.com';
$toheader = 'Vincent Whipple';
}
if ($_POST['emailaddy3']) {
$emailvalue = 'asousa@sono-tek.com';
$toheader = 'Luis Abarca';
}
if ($_POST['emailaddy4']) {
$emailvalue = 'asousa@sono-tek.com';
$toheader = 'Claudine Corda';
}
if ($_POST['emailaddy5']) {
$emailvalue = 'asousa@sono-tek.com';
$toheader = 'Robb Engle';
}
if ($_POST['emailaddy6']) {
$emailvalue = 'asousa@sono-tek.com';
$toheader = 'Christopher L. Coccio';
}
if ($_POST['emailaddy7']) {
$emailvalue = 'asousa@sono-tek.com';
$toheader = 'for more information';
}
//type of email
$header = "MIME-Version: 1.0\r\n";
$header .= "Content-type: text/plain; charset=iso-8859-1\r\n";
$header .= "From: $name <$email>";
//validate random validation number and if name and email were entered
if (isset($_POST['txtNumber'])) {
if (empty($name)){
$nameerror = "<tr>
<td colspan=2 class=emptyfield>! Please provide your name !</td>
</tr>";
} if (empty($email)) {
$emailerror = "<tr>
<td colspan=2 class=emptyfield>! Please provide your email !</td>
</tr>";
}
$number = $_POST['txtNumber'];
if (md5($number) == $_SESSION['image_random_value']) {
//mail the form to the correct email
mail($sendto,$subject,$body,$header);
header("location:http://www.sono-tek.com/forms/thanks.php");
exit;
} else {
$validerror = "<tr>
<td colspan=2 class=emptyfield>! You must enter the CORRECT Validation Number to continue !</td>
</tr>";
}
}
?>
Thanks for the help
Antoni