In the confirmation Email I receive when someone uses the contact form I get all the info EXCEPT the phone number ( it is blank ) script is below
<?php
$EmailFrom = "Million-heirs.com";
$EmailTo = "admn@million-heirs.com,vze2btvh@verizon.net";
$Subject = "Million-heirs.com";
$Name = Trim(stripslashes($_POST['Name']));
$Tel = Trim(stripslashes($_POST['Tel']));
$Email = Trim(stripslashes($_POST['Email']));
$Message = Trim(stripslashes($_POST['Message']));
// validation
$validationOK=true;
if (!$validationOK) {
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
exit;
}
// prepare email body text
$Body = "";
$Body .= "Name: ";
$Body .= $Name;
$Body .= "\n";
$Body .= "Tel: ";
$Body .= $Tel;
$Body .= "\n";
$Body .= "Email: ";
$Body .= $Email;
$Body .= "\n";
$Body .= "Message: ";
$Body .= $Message;
$Body .= "\n";
// send email
$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");
// redirect to success page
if ($success){
print "<meta http-equiv=\"refresh\" content=\"0;URL=contactthanks.php\">";
}
else{
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
}
?>
Phone number not displaying in confirmation email
Moderator: General Moderators
-
ralphiedee
- Forum Newbie
- Posts: 8
- Joined: Fri Jul 18, 2008 10:59 pm
Re: Phone number not displaying in confirmation email
The code itself looks fine (though it would look better wrapped in syntax tags). Have you tried echoing $Tel?
On an unrelated note, this is a little pointless:
On an unrelated note, this is a little pointless:
Code: Select all
$validationOK = true;
if (!$validationOK)Re: Phone number not displaying in confirmation email
I would check to see if your name for your input matches your:
Is it named: Tel or tel for instance and that could be why your not getting the variable. Check your variable to see if it is empty or not. 
Don't really know why this is used though:
Is there something missing from your code that we are not seeing here? 
Code: Select all
$Tel = Trim(stripslashes($_POST['Tel'])); Don't really know why this is used though:
Code: Select all
// validation
$validationOK=true;
if (!$validationOK) {
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
exit;
}