简体   繁体   中英

Login page shows blank

The login page on a project i'm currently fixing up shows blank. i tried echoing some words to find out where the fault lied. I found out that commenting out the below piece of code made it to display.

elseif( isset($_POST['do_login'] ) ){ //Login user

    $email = (isset($_POST['login']) && is_string($_POST['login'])
                && strlen($_POST['login'])<100)?$_POST['login'] : null;
    $password  = (isset($_POST['password']) && is_string($_POST['password'])
                && strlen($_POST['password'])<100)?$_POST['password'] : null;
    $remember  = isset($_POST['chkremember']) ? true : false;

    $result = $auth->login($email, $password, $remember);

    switch($result){
        case 1:
            $msg = 'You have successfully logged in.'
            break;    
        case 2:
            $msg = 'Your account has not yet been confirmed. <br/> Please check the e-mail message sent by us and click the confirmation code to validate this account. <a href="user_login.php?view=resend&resend_email='.$email.'">resend activation e-mail</a>';
            break;
        case 3:
            $msg = 'Your account is not enabled!';
            break;
        case 4:
            $msg = 'Account with given login credentials does not exist!';
            break;
    }
}

Can anyone help me figiure out what's wrong with this piece of code?

in case 1 , you miss ; before break .

 case 1: $msg = 'You have successfully logged in.'   break;  

分号在中断前丢失;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM