haydndup Posted May 27, 2006 Share Posted May 27, 2006 How would i get php to find the name of the file being viewed?ie -> i have a 'left.php' which is included in all pages on a site. But i want this content to change based on which file is viewing it ->index.php, about.php, contact.php etc. I want to use a set of if statements to determine the name of the file being viewed, and based on that, echo out content that is page specific...I hope this makes sense..TIA Link to comment https://forums.phpfreaks.com/topic/10568-name-of-file-being-viewed/ Share on other sites More sharing options...
AndyB Posted May 27, 2006 Share Posted May 27, 2006 $_SERVER['PHP_SELF'] or $_SERVER['SCRIPT_NAME'] Link to comment https://forums.phpfreaks.com/topic/10568-name-of-file-being-viewed/#findComment-39419 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.