Hello,
This is my first time here ... i have read some threads here ... it's very helpful.
I have an urgent question ............ why this contact form is submitting blank emails ????
like this :
Company:\nEmail:\nContacts:\nMessage:\n
This is the contact form:
<form id="ContactForm" method="post" action="contactengine.php">
<div>
<div class="wrapper">
<span>Company:</span><input type="text" class="input" >
</div>
<div class="wrapper">
<span>Email:</span><input type="text" class="input" >
</div>
<div class="wrapper">
<span>Contacts:</span><input type="text" class="input" >
</div>
<div class="textarea_box">
<span>Message:</span><textarea name="textarea" cols="1" rows="1"></textarea>
</div>
<span> </span>
<input type="submit" name="submit" value="Send" class="button" />
</div>
</form>
This is the contact engine . php
<?php
$EmailFrom = "From Our Website";
$EmailTo = "admin@crcarabia.com";
$Subject = " ";
$Company = Trim(stripslashes($_POST['Company:']));
$Email = Trim(stripslashes($_POST['Email:']));
$Contacts = Trim(stripslashes($_POST['Contacts:']));
$Message = Trim(stripslashes($_POST['Message:']));
// validation\par
$validationOK=true;
if (!$validationOK) {
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
exit;
}
// prepare email body text
$Body = "";
$Body .= "Company:";
$Body .= $Company;
$Body .= "\\n";
$Body .= "Email:";
$Body .= $Email;
$Body .= "\\n";
$Body .= "Contacts:";
$Body .= $Contacts;
$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\">";
}
?>
and this is the contact thanks . php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN"> <head>
<title>CRC Arabia</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<div id="page-wrap">
<br /><br />
<h1>Your message has been sent!</h1><br />
<p><a href="Contact.html">Back to Contact Form</a></p>
<p><a href="index.html">Back to Home</a></p>
</div>
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript"> \tab _uacct = "UA-68528-29"; \tab urchinTracker(); </script>
</body>
</html>
Thanks in advance for your help 🙂