-3

I have no idea what is wrong with this line of my code, I keep getting the message

"Parse error: syntax error, unexpected '{' in C:\xampp\htdocs\form.php on line 27"

when loading the page in live preview on brackets. Can you help me please?

 if ($_POST['email'] && filter_var($_POST["email"],
        FILTER_VALIDATE_EMAIL) === false) { 
          $error.= "The email address is invalid.<br />";
 }
Tetsuya Yamamoto
  • 24,297
  • 8
  • 39
  • 61

1 Answers1

0

If you are sure that line 27 is OK, then you should look for the lines from 1 to 26. If you have some brackets { } missing or extra on those line PHP generates this error, since it might think that you already closed a bracket and putting an unwanted one. So check line 1 to 26 for brackets

masterFly
  • 1,072
  • 12
  • 24