Just trying to get a very simple form working Getting a Parse error: syntax error, unexpected T_IS_EQUAL on line 10
<?php $to = ""; $subject = "Contact Us"; $name = $_REQUEST['name'] ; $email = $_REQUEST['email'] ; $message = $_REQUEST['message'] ; $headers = "From: $email"; $embody = "Name: $name\nEmail: $email\nSuggestion: $message" ; $sent = mail($to, $subject, $embody, $headers) ; if($name || $email || $message) == "" { echo "You seem to have left something out. Please fill in all the fields and try again.<a href=\"javascript:closeWindow();\">Close</a>"; } else if($sent) {echo "Thank you $name, your mail has been sent successfully with the message of:<i>$message</i><a href=\"javascript:closeWindow();\">Close</a>"; } else {echo "We encountered an error sending your mail<a href=\"javascript:closeWindow();\">Close</a>"; } ?>I know its something with the checking if the fields are blank, but I can't find what Thanks
In the above code you forgot to put
braces for the if statement, try the following
if(($name || $email || $message) == "")
Thanks & Regards
Sai Prem