Parse Syntax error

This one is an example from a book… i really don’t get it why i get this parse error… i followed everything but i still get this error… parse error: syntax error: unexpected ‘;’

What’s is the reason why it gets an error like this? and how to avoid it?

[php]

<?php // 13.5 - login.php $loggedin = false; $error = false; if ($_SERVER['REQUEST_METHOD'] == 'POST') { if (!empty($_POST['email']) && !empty($_POST['password'])) { if ( (strtolower($_POST['email']) == '[email protected]') && ($_POST['password'] == 'testpass') ) { setcookie('Jane', 'Suan', time()+3600); $loggedin = true; } else { $error = 'The submitted email address and password do not match those on file!'; } } else { $error = 'Please make sure you enter both an email address and a password!';// this part i get the syntax error... } } define('TITLE', 'Login'); include('templates/header.html'); if ($error) { print '

' . $error . '

'; } if ($loggedin) { print '

You are now logged in!

'; } else { print'

Login Form

Email Address

Password

'; } include('templates/footer.html'); ?>

[/php]

Hmm… I am not seeing any syntax errors in this code.

thanks for your comment… i’m so silly that i didn’t notice where the error refer to… the script above is my login script and the error it gets was from the hearder.html… the error is there…

it’s on the comment line… grrr…

lesson learned… always see the error message carefully…

Sponsor our Newsletter | Privacy Policy | Terms of Service