login.php - parse error
Hey all, here is my login.php:
PHP:<?php // Script 8.8 - login.php
// This page lets users log into the site
// Set the page title and include the header file
define ('TITLE', 'Login');
require ('templates/header.html');
// Basic HTML formatting stuff
print '<div id="leftcontent">
<h1>Login Form</h1>
<p>Users who are logged in can take advantage of certain features like this, that, and the other thing.</p>';
// Check if the form has been submitted
if ( isset ($_POST['submit'])) {
// Handle the form
if ( (!empty ($_POST['username'])) && (!empty ($_POST['password'])) ) {
if ( ($_POST['username'] == 'testing') && ($_POST['password'] == 'testpass') ) { // Okay
print '<p>You are now logged in!<br />Now you can blah, blah, blah...</p>';
} else { // Not okay
print '<p>The submitted username and password do not match those on file!<br />Go back and try again.</p>';
}
} else // Forgot a field
print '<p>Please make sure you enter both a username and a password!<br />Go back and try again.</p>';
}
} else {
// Display the form
print '<form action="login.php" method="post"><p>
Username: <input type="text" name="username" size="20" /><br />
Password: <input type="password" name="password" size="20" /><br />
<input type="submit" name="submit" value="Log In!" /></p>
</form>';
} // End of main conditional
// Complete the HTML formatting stuff
print '</div';
require ('templates/footer.html'); // Need the footer
?>
The error I'm getting is
Quote:Parse error: parse error, unexpected '}' in /home/jmeeter/public_html/php/PHP For the World Wide Web/elliottsmith/login.php on line 35
Everything looks right to me... What is the problem?
According to Dreamweaver, line 35 is the "} else {" above my comment "// Display the form".
