Banner

Sponsor

Login


Welcome Back!
Guest
Guest

Register

Lost your password?

79 users online



login.php - parse error

login.php - parse error

Currently viewing this thread: 1 (0 members and 1 guests)


bleedwithme

bleedwithme

i do my crosswords in pen
Status: Offline!

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? pff According to Dreamweaver, line 35 is the "} else {" above my comment "// Display the form".

Alekz

Alekz

So what's up :)
Status: Offline!

I think you missed a {

PHP:

<?php

} else // Forgot a field || Right here
    
        
print '<p>Please make sure you enter both a username and a password!<br />Go back and try again.</p>';
        
        }
        

?>

So:

PHP:

<?php

} else { // Forgot a field
    
        
print '<p>Please make sure you enter both a username and a password!<br />Go back and try again.</p>';
        
        }
        

?>

___________________

"¿Por qué buscais la felicidad, oh, mortales, fuera de vosotros mismos?"
~Boecio

Quick Jump:

Main Navigation


Site & Graphic Design by Aeon Tan
Developed by Jeremie Pelletier & Scott Roach


NeverAPI generated this page in 0.0087 seconds.