PHP Restrict Access to Page() problem!

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Post Reply
MeroD
New php-forum User
New php-forum User
Posts: 53
Joined: Wed Oct 10, 2012 12:14 am

Re: PHP Restrict Access to Page() problem!

Post by MeroD » Wed Oct 24, 2012 11:23 pm

Try this logic?

Code: Select all

<?php  
    if(!empty($_SESSION['LoggedIn']) && !empty($_SESSION['Username']))  
    {  
        // let the user access the restricted page  
    }  
    elseif(!empty($_POST['username']) && !empty($_POST['password']))  
    {  
        // let the user login  
    }  
    else  
    {  
        // display the login form  
    }  
    ?>

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests