PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
tommy1987
Forum Commoner
Posts: 92 Joined: Tue Feb 21, 2006 8:35 pm
Post
by tommy1987 » Sun Sep 03, 2006 11:16 am
Can anyone point me in the right direction, I want to obtain the filename (e.g. index.php)
Then I can do:
Code: Select all
if($fileName == index.php) {
//Shade home button because we are there.
}
klarinetking
Forum Commoner
Posts: 59 Joined: Mon Jul 24, 2006 9:43 am
Post
by klarinetking » Sun Sep 03, 2006 11:31 am
You mean getting the filename from the URL? Take a look at $_SERVER.
See what this code produces.
Code: Select all
echo '<pre>';
print_r($_SERVER);
echo '</pre>';
jayshields
DevNet Resident
Posts: 1912 Joined: Mon Aug 22, 2005 12:11 pm
Location: Leeds/Manchester, England
Post
by jayshields » Sun Sep 03, 2006 11:43 am
Or just use __FILE__