My contact form is not working.
Here is my html code for my contact form which is located in Contact.htm :
<form method="POST" action="contact.php">
<p>Name:<br>
<input type="text" name="Name:">
<p>Company:<br>
<input type="text" name="Company:">
<p>Phone:<br>
<input type="text" name="Phone:">
<p>Email:<br>
<input type="text" name="Email:">
<p>Comments:<br>
<textarea name="Comments:" cols="45" rows="5"></textarea>
<p><input type="submit" name="submit" value="Submit">
</form>
Here is my code which is located in my php file contact.php :
<?php
mb_http_input("UTF-8");
mb_http_output("UTF-8");
$EmailFrom = Trim(stripslashes($_POST['EmailFrom']));
$EmailTo = "cproett805@gmail.com";
$Subject = "Web Contact Form";
$Name: = Trim(stripslashes($_POST['Name:']));
$Company: = Trim(stripslashes($_POST['Company:']));
$Phone: = Trim(stripslashes($_POST['Phone:']));
$Email: = Trim(stripslashes($_POST['Email:']));
$Comments: = Trim(stripslashes($_POST['Comments:']));
$validationOK=true;
if (Trim($EmailFrom)=="") $validationOK=false;
if (!$validationOK) {
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
exit;
}
$Body = "";
$Body .= "Name:: ";
$Body .= $Name:;
$Body .= "\n";
$Body .= "Company:: ";
$Body .= $Company:;
$Body .= "\n";
$Body .= "Phone:: ";
$Body .= $Phone:;
$Body .= "\n";
$Body .= "Email:: ";
$Body .= $Email:;
$Body .= "\n";
$Body .= "Comments:: ";
$Body .= $Comments:;
$Body .= "\n";
$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");
if ($success){
print "<meta http-equiv=\"refresh\" content=\"0;URL=ok.htm\">";
}
else{
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
}
?>
------------------------------------------------------------
The error I get when I submit the information on the form is:
Parse error: syntax error, unexpected ':' in D:\Hosting\5199406\html\contact.php on line 8
Line 8 = $Name: = Trim(stripslashes($_POST['Name:']));
I actually took this line out to see if it would work and then it gave me an error that Line 9 was not working...
HELP PLEASE!
