Joshua F Posted September 6, 2010 Share Posted September 6, 2010 I am trying to make a tip.php thing, that can be opened in a link and give a top about that page. I am trying to make a default one. Here's my code <?php session_start(); include "../includes/connect.php"; include "../includes/config.php"; if(isset($_SESSION['admin2'])){ //Add Page if($_GET['title'] == 'addpage') { echo "There is not a tip to this page."; } } else { echo "You are not logged in as an administrator."; } ?> I have tip.php?action=addpage and it will echo that, but I want one that if there isn't a code for, it will do a default saying "There is not a tip for this page". Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted September 6, 2010 Share Posted September 6, 2010 Note quite sure I follow you exactly, but you want a new window to popup that will show tips for the page they are on. But not all pages have tips, is that right? If so, you can manually define which pages do not have tips in an array. $no_tips = array('page_title_1','page_title_2','page_title_3'); if(in_array($_GET['title'], $no_tips)){ echo 'There are no tips to this page.'; } Quote Link to comment Share on other sites More sharing options...
Joshua F Posted September 6, 2010 Author Share Posted September 6, 2010 Note quite sure I follow you exactly, but you want a new window to popup that will show tips for the page they are on. But not all pages have tips, is that right? If so, you can manually define which pages do not have tips in an array. $no_tips = array('page_title_1','page_title_2','page_title_3'); if(in_array($_GET['title'], $no_tips)){ echo 'There are no tips to this page.'; } I'll just use this, seems easy to use. 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.