Jump to content

advanced login problem


magie

Recommended Posts

i have tryed making a big login system, where ppl have to activate and all that, but i get this error all the time, what am i doing wrong

 

Parse error: syntax error, unexpected T_IF in /home/twossdow/public_html/magie/login.php on line 3

 

<?php
if (!isLoggedIn())
{
    // user is not logged in.
    if (isset($_POST['cmdlogin']))
    {
        // retrieve the username and password sent from login form & check the login.
        if (checkLogin($_POST['username'], $_POST['password']))
        {
            show_userbox();
        } else
        {
            echo "Incorrect Login information !";
            show_loginform();
        }
    } else
    {
        // User is not logged in and has not pressed the login button
        // so we show him the loginform
        show_loginform();
    }

} else
{
    // The user is already loggedin, so we show the userbox.
    show_userbox();
}
?>

Link to comment
https://forums.phpfreaks.com/topic/151398-advanced-login-problem/
Share on other sites

usually these errors consist of a non closed if statement before the actual line that seems to be bugging.

try looking into your isLoggedIn() function and see if everything is closed as it should be'.

 

if this page is included by other pages, you should check those pages for non closed if statements

 

u can test your current code without the isLoggedIn() function by replacing the

if (!isLoggedIn())

with

if(TRUE)

 

hope this helps.

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.