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; ?> Link to comment https://forums.phpfreaks.com/topic/219023-if-statement-not-working/ 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 Link to comment https://forums.phpfreaks.com/topic/219023-if-statement-not-working/#findComment-1135882 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 Link to comment https://forums.phpfreaks.com/topic/219023-if-statement-not-working/#findComment-1135906 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; ?> Link to comment https://forums.phpfreaks.com/topic/219023-if-statement-not-working/#findComment-1135913 Share on other sites More sharing options...
zhshero Posted November 18, 2010 Author Share Posted November 18, 2010 thanks Link to comment https://forums.phpfreaks.com/topic/219023-if-statement-not-working/#findComment-1135914 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.