How do you retrieve the name of the script that included or required it?
Example: script login.php has a require_once(\'validate.php\') ... validate.php is also cal
Try $_SERVER['SCRIPT_NAME'];
$_SERVER['SCRIPT_NAME'];
More here: http://php.net/manual/en/reserved.variables.server.php