HDFilmMaker2112 Posted September 12, 2011 Share Posted September 12, 2011 The below isn't triggering the second if statement: if($_GET['admincp']!=""){ echo '<div class="center"><a href="./index.php?admincp">Admin CP</a>'; if($_GET['do']=="edit"){ (isset($_GET['id']) ? ' » <a href="./index.php?admincp=users&do=edit">Edit Users</a>' : ''); } elseif($_GET['view']=="accounts"){ (isset($_GET['id']) ? ' » <a href="./index.php?admincp=investors&view=accounts">View Accounts</a>' : ''); } echo '</div>'; } When a user is at index.php?admincp=users&do=edit&id=someid they should see Admin CP >> Edit Users When a user is at index.php?admincp=investors&view=accounts&id=someid they should see Admin CP >> View Accounts Right now only Admin CP shows up. Quote Link to comment https://forums.phpfreaks.com/topic/247009-not-triggering-if-statement/ Share on other sites More sharing options...
Pikachu2000 Posted September 12, 2011 Share Posted September 12, 2011 You aren't echoing anything past the Admin CP link. The ternary statements should be in this format. echo isset($_GET['id']) ? ' » <a href="./index.php?admincp=users&do=edit">Edit Users</a>' : ''; Quote Link to comment https://forums.phpfreaks.com/topic/247009-not-triggering-if-statement/#findComment-1268552 Share on other sites More sharing options...
HDFilmMaker2112 Posted September 12, 2011 Author Share Posted September 12, 2011 Crap... thanks. I moved them out of an existing echo and forget to put another echo in front of them. Quote Link to comment https://forums.phpfreaks.com/topic/247009-not-triggering-if-statement/#findComment-1268558 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.