Jump to content

Archived

This topic is now archived and is closed to further replies.

haydndup

Name of file being viewed

Recommended Posts

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

Share this post


Link to post
Share on other sites
$_SERVER['PHP_SELF'] or $_SERVER['SCRIPT_NAME']

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.