I have a pages on my site which use other PHP files for the content.
Here is an example:
file1.php:
<!-- header and other stuff goes here -->
<?php include 'file2.php; ?>
<!-- footer and other stuff goes here -->
file2.php:
<?php echo $_SERVER['SCRIPT_FILENAME']; ?>
<p>Content goes here.</p>
My problem is that the SCRIPT_FILENAME variable is echoing out as file1.php because it is included in File 1. How do I stop that from happening and get the SCRIPT_FILENAME of the included file (file2.php).