Test if a php include is called from a local file
<p>I have a php include with one function in it, I need to ensure that it can only be executed by inclusion within a local file and not from any external source. </p>

<p>What is the best method of testing for this?</p>

<p>-thanks
-sean</p>

<p>UPDATE:</p>

<p>thanks, here is some more info,
- I can't move it outside the webroot, I'm updating an existing site
- testing for REMOTE_ADDR will always return the clients ip
- the only way I want this file called is by: include_once "sendmail.php";</p>
