Limiting php file to localhost only
<p>Is there some way to limit loading of a php file to localhost only?</p>

<p>I'm including some php files in my index.php file to stich together a webpage.  Lets say I'm including main.php in my index.php file.  Now there is nothing that can stop anyone from loading the main.php file and displaying its content.  As the main.php file is made to be stiched into the index.php file it doesn't look good alone.</p>

<p>Is there some code I can put in the main.php file so it doesn't output anything if not included from a localhost php file?</p>

<p>Something like:</p>

<p>
.
.
.</p>
