-
Files filename
Is there a way to find out what file the user is viewing?
I'm hoping there is a fuction for this, its not a simple as as you might think. I have a set of files that the user can open, Say: index.php, request.php, staff.php, ect.... But when those files are opened they will all include the template.php file and inside this I want to beable to tell what the original file was entered. Also the template file sometimes includes files and I will need to still access the file name from these too.
I know I could do this with a variable in every file but I was wondering if there was a function that could do it?
Thanx
-
PHP Code:
<?
$currentFile = $_SERVER["SCRIPT_NAME"];
$parts = Explode('/', $currentFile);
print $parts[count($parts) - 1];
?>
That should do the trick.
-
Thanx, just what I needed.