dvayne Posted April 10, 2008 Share Posted April 10, 2008 <?php session_start(); if($_SESSION['s_logged_n'] == 'true'){ include 'process.php'; $query = mysql_query("SELECT * FROM Users where position=admin") or die(mysql_error()); while($row = mysql_fetch_array($query));{ if(mysql_num_rows($query) > 0) { if($row['Activated'] > 0){ $_SESSION['adminl'] = 'true'; header("Location: adminpanel.php"); } else{ echo 'access denied'; } } } } else { header("Location: login.php"); } ?> please check my code It displays access denied even if the position that is stored in database is admin.. any help would be appreciated.. Quote Link to comment Share on other sites More sharing options...
paul2463 Posted April 10, 2008 Share Posted April 10, 2008 fora start off you can remove the semi colon from the "While($row" line it will stop it working Quote Link to comment Share on other sites More sharing options...
Daniel0 Posted April 10, 2008 Share Posted April 10, 2008 You also need to change the query to SELECT * FROM Users where position='admin' Quote Link to comment Share on other sites More sharing options...
dvayne Posted April 10, 2008 Author Share Posted April 10, 2008 thank you very much.. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.