View Single Post
  #2 (permalink)  
Old 02-29-2008, 05:37 AM
proxomos's Avatar
proxomos proxomos is offline
Junior Member
 
Join Date: Feb 2008
Posts: 1
Cool

PHP Code:
$admin mysql_query('SELECT admin FROM users'); 

if (
$admin == 0) { 
//then redirect them to the members area 
header("Location: members.php"); 

else 

//then redirect them to the admin area 
header("Location: admin.php"); 

I would do:

PHP Code:
$result mysql_query("SELECT admin FROM users");
list(
$admin)=mysql_fetch_row($result);

switch (
$admin){
case 
0:
   
header("Location: members.php");
   break;

case 
1:
  
header("Location: admin.php");
  break;

Hope that helps

Proxomos
Reply With Quote