Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jul 2007
    Location
    UK
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Showing the admin panel when login.

    Hi, i am having a problem with trying to show the admin panel when i login. This is the code so far:
    PHP Code:
    <?php

    if(@$_SESSION['Loggedin'] == 'true')
    {require
    'logged_in_options.php';} 
    else 
    {@
    $_SESSION['Loggedin'] = 'false';

    ?>

    --The Login Box Is Here--

    <?php ?>

    <?php

    if ($_SESSION['Loggedin'] == 'usernamehere'){
    $_SESSION['admin'] = 'true';}
    else{
    $_SESSION['admin'] = 'false';}
    if (
    $_SESSION['admin'] == 'true'){
    require 
    'admin_panel.php';}

    ?>
    The problem is, is that it still shows the admin panel for all users, can anyone spot the problem, please let me no. Thanks for your replies.

  • #2
    SMC
    SMC is offline
    New Coder
    Join Date
    Jun 2007
    Location
    Orlando, FL
    Posts
    60
    Thanks
    5
    Thanked 2 Times in 2 Posts
    Well for one your not calling session_start(); therefore the script has no reference to your $_SESSION variables.

  • #3
    New Coder
    Join Date
    Jul 2007
    Location
    UK
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by SMC View Post
    Well for one your not calling session_start(); therefore the script has no reference to your $_SESSION variables.
    Yes but the page acctually does have session_start();
    http://www.smgames.staticfire.co.uk Under construction, Currently hiring mods and admins anyone interested pm me.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •