Page 1 of 1

obtaining filename

Posted: Sun Sep 03, 2006 11:16 am
by tommy1987
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.
}

Posted: Sun Sep 03, 2006 11:31 am
by klarinetking
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>';

Posted: Sun Sep 03, 2006 11:43 am
by jayshields
Or just use __FILE__