<?php

$EmailFrom = "webmaster@panda-hits.com";
$EmailTo = "webmaster@panda-hits.com";
$Subject = "Product Listing!";
$Name = Trim(stripslashes($_POST['Name'])); 
$Tel = Trim(stripslashes($_POST['Tel'])); 
$Image = Trim(stripslashes($_POST['Image']));
$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 .= "User: ";
$Body .= $Name;
$Body .= "\n";
$Body .= "Product Title: ";
$Body .= $Tel;
$Body .= "\n";
$Body .= "Sales Page url: ";
$Body .= $Email;
$Body .= "\n";
$Body .= "Product Description: ";
$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=https://panda-hits.com/listing2/pending-review.php\">";
}
else{
  print "<meta http-equiv=\"refresh\" content=\"0;URL=https://panda-hits.com/listing2/pending-review.php\">";
}
?>
