Posted by thehuby on 04/27/06 01:45
How do you get the name of the currently execting script?
By this I mean the name of the include file that is being executed:
File: include.php
<?php
//Call some function to display include.php or whatever my filename is
?>
File: holder.php
<?php
inlcude( "include.php" );
?>
I tried everything in the $_SERVER variable but to no avail - Googling
it doesn't help as it all points to either the include method or the
$_SERVER variable. These all just give me 'holder.php' or similar.
I want this as I want to create a LOGGER class similar to the one in
Java to catch errors and keep them logged in a file I can download from
time to time.
[Back to original message]
|