I know little php and im trying to utilize the code i have found. this prints out the members package: <? print Q("select gName as result from frm_groups where groupid =".$_SESSION['groupid'],$connector); ?> so i thought if i did this it direct accordingly.......im not sure what$connector does. <? if("select gName as result from frm_groups where groupid =".$_SESSION['groupid'],$connector)=="Admin") { header('Location:admin.php'); } else { header('Location:login.php'); } ?>
Depending on what you're trying to do: <? $sql = "select gName as result from frm_groups where groupid =".$_SESSION['groupid']; $result = mysql_query($sql); $r = mysql_fetch_array($result); if ($r['gName'] == 'Admin') { header('Location:admin.php'); } else { header('Location:login.php'); } ?> Code (markup): Or <? if ($_SESSION['groupid'] == 'ADMIN VALUE ID HERE') { header('Location:admin.php'); } else { header('Location:login.php'); } ?> Code (markup):