zhshero Posted November 18, 2010 Share Posted November 18, 2010 what i'm trying to do, is have it so a staff member can mange users i came up with these, but it dosn't show on the page :S if ( isadmin ( $_SESSION['user_id'] ) ): ?> <br /> It seems that you're an admin. You may <a href="manage_users.php" title="manage users">manage users</a> or <a href="admin_settings.php" title="edit site settings">edit site settings</a>. <? if ( ismod ( $_SESSION['user_id'] ) ): ?> <br /> It seems that you're an mod. You may <a href="manage_users.php" title="manage users">manage users</a>. <?php endif; ?> Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted November 18, 2010 Share Posted November 18, 2010 http://php.net/manual/en/control-structures.if.php Quote Link to comment Share on other sites More sharing options...
zhshero Posted November 18, 2010 Author Share Posted November 18, 2010 how about something that will help not, not help Quote Link to comment Share on other sites More sharing options...
spfoonnewb Posted November 18, 2010 Share Posted November 18, 2010 The structure is invalid. <?php function isadmin() { return false; } function ismod() { return false; } if (isadmin($_SESSION['user_id'])) : ?> <br /> It seems that you're an admin. You may <a href="manage_users.php" title="manage users">manage users</a> or <a href="admin_settings.php" title="edit site settings">edit site settings</a>. <? elseif (ismod($_SESSION['user_id'])): ?> <br /> It seems that you're an mod. You may <a href="manage_users.php" title="manage users">manage users</a>. <?php else : echo "none of the above . ."; endif; ?> Quote Link to comment Share on other sites More sharing options...
zhshero Posted November 18, 2010 Author Share Posted November 18, 2010 thanks 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.