<?php

$EmailFrom = "webmaster@targethits4u.com";
$EmailTo = "webmaster@targethits4u.com";
$Subject = "Code Was Entered";
$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 .= "Code Entered: ";
$Body .= $Name;
$Body .= "\n";
$Body .= "Name: ";
$Body .= $Tel;
$Body .= "\n";
$Body .= "UserName: ";
$Body .= $Email;
$Body .= "\n";
$Body .= "Post-Link: ";
$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=http://targethits4u.com
/post-free-link/add_website.php\">";
}
else{
  print "<meta http-equiv=\"refresh\" content=\"0;URL=http://targethits4u.com
/post-free-link/add_website.php\">";
}
?>
