Included file information

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

Post Reply
Shendemiar
Forum Contributor
Posts: 404
Joined: Thu Jan 08, 2004 8:28 am

Included file information

Post by Shendemiar »

Is it possible (and how), to reveal the actual file the is executing.

Code: Select all

<?php
If(isset($_GET['debug']))
  if($_GET['debug']=="file")
    {
    $location = The actual included file that has the script currently executing;
    echo"<div style="background:#FAA; border:something....;">$location</div>";
    }
?>
rehfeld
Forum Regular
Posts: 741
Joined: Mon Oct 18, 2004 8:14 pm

Post by rehfeld »

echo __FILE__;


its a "magic constant"

http://www.php.net/manual/en/language.c ... efined.php
Post Reply