Hi all,

So I'm a PHP rookie that is working on a website for my web design work. I will just post the code and see if anyone can help me find the solution. Firefox says that "Parse error: syntax error, unexpected T_ELSE, expecting '(' in contact.php on line 38". So I've tried changing some things around based upon info I've found on various forums, but to no avail. Here's the code. Thank you all for your help!

BTW line 38 is the "if else{" line a few lines up from the bottom.


$EmailFrom = $_REQUEST['email']; 
$Email_To = '(my email)'; // Your email address here
$Subject = "Contact form";
$Name = Trim(stripslashes($_POST['name'])); 
$Email = Trim(stripslashes($_POST['email'])); 
$Message = Trim(stripslashes($_POST['message'])); 

// validation
if (!$validationOK) {
  echo "Error";

// prepare email body text
$Body = "";
$Body .= "Name: ";
$Body .= $Name;
$Body .= "\n";
$Body .= "Email: ";
$Body .= $Email;
$Body .= "\n";
$Body .= "Message: ";
$Body .= "\n";
$Body .= "\n";
$Body .= $Message;
$Body .= "\n";

// send email 
$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");

// redirect to success page 
if ($success){
  echo "Success";
if else{
  echo "Error";
Note that where it says "(my email)" in the actual file I do have my email address there.