...

View Full Version : Showing the admin panel when login.



SMGames
07-01-2007, 12:06 PM
Hi, i am having a problem with trying to show the admin panel when i login. This is the code so far:


<?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.

SMC
07-01-2007, 10:12 PM
Well for one your not calling session_start(); therefore the script has no reference to your $_SESSION variables.

SMGames
07-02-2007, 08:01 AM
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();



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum