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? Link to comment https://forums.phpfreaks.com/topic/79041-solved-analyze-current-url-for-a-directory/ 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"; } ?> Link to comment https://forums.phpfreaks.com/topic/79041-solved-analyze-current-url-for-a-directory/#findComment-400015 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.