runnerjp Posted November 8, 2008 Share Posted November 8, 2008 im trying to show where users are on my forum.. just like on here * PHP Freaks Forums > * PHP Coding > * PHP Help > * Start new topic and i want it to be in just 1 file... so far i have this <a href="http://www.runningprofiles.com/members/index.php?page=mainforums">runningprofiles forums</a> > <?php echo $forum; ?> > topic with the topic i only want the link to show if they are on certain pages in my website.. so here are a few following examples index.php?page=message index.php?page=post index.php?page=reply could i make an if statement to somehow check if the user is viewing that page? Quote Link to comment Share on other sites More sharing options...
zq29 Posted November 8, 2008 Share Posted November 8, 2008 could i make an if statement to somehow check if the user is viewing that page? Yes, you could. FYI, you will most likely run into validation issues using '>' outside of a tag - Use > instead Quote Link to comment Share on other sites More sharing options...
runnerjp Posted November 8, 2008 Author Share Posted November 8, 2008 lol ok next question would be what would the if statement look like?? if(what?) { echo 'post meassge'; } Quote Link to comment Share on other sites More sharing options...
zq29 Posted November 8, 2008 Share Posted November 8, 2008 <?php $show = array('message','post','reply'); if(in_array($_GET['page'],$show)) { echo 'foo'; } ?> Quote Link to comment Share on other sites More sharing options...
runnerjp Posted November 8, 2008 Author Share Posted November 8, 2008 ahh yes comparing it to an array... 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.