tmallen Posted November 27, 2007 Share Posted November 27, 2007 I need to hide a part of my site from certain pages, all of which can be found in the projects/ directory. How can I test for this being in the current URL? Quote Link to comment Share on other sites More sharing options...
~n[EO]n~ Posted November 27, 2007 Share Posted November 27, 2007 you can find the current page like this <?php ## this line will return the current page :: $pageName=basename($_SERVER['PHP_SELF'] ); ## this will search filename in current directory $filename = $pageName; if (file_exists($filename)) { echo "The file $filename exists"; } else { echo "The file $filename does not exist"; } ?> 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.