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 Quote 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'] Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.