Well, although i'm still a complete newb, I am getting better at finding my own errors 🙂
However, in the following code, i can't seem to find it: Here's the code that's giving me that unexpected T_ELSE error:
<?php
if ($_POST['submit'] == true) {
//set variables
$name = htmlspecialchars($_POST['yourName']);
if ($_POST['yourPhone1'] || $_POST['yourPhone2'] || $_POST['yourPhone3'] =='') {
$phone = "was not provided";
} else {
$phone = "(".htmlspecialchars($_POST['yourPhone1']).")";
$phone .= " ".htmlspecialchars($_POST['yourPhone2'])."-";
$phone .= htmlspecialchars($_POST['yourPhone3']);
}
$email = htmlspecialchars($_POST['yourEmail']);
$inquiryType = htmlspecialchars($_POST['glassType']);
$msg = htmlspecialchars($_POST['message']);
$subject = "Contact from the Website";
$message = "Name: $name\nPhone: $phone\nEmail: $email\n\n Inquiry Type: $inquiryType\n\nMessage: $msg\n\nYou may reply to this message to send an email to the customer.\n\n";
//mail function and spammage checker
if ($_POST['website'] != '') {
exit('Please do not use our site for spam');
} else {
mail('jason@mainstreetcomp.com', "$subject", "$message","From:$email");
?>
<HTML>
<HEAD></HEAD>
<BODY>
Thank you for contacting us
</BODY>
</HTML>
<?php
} else {
?>
<HTML>
<HEAD></HEAD>
<BODY>
<form action="<?php echo $_SERVER['PHP_SELF'];?>" method="POST">
<!-- form body -->
</form>
</BODY>
</HTML>
<?php
}
?>
What am i missing? 😕
Thanks in advance guys!
J