title: Prevent direct access to a php include file
body: <p>I have a php file which I will be using as exclusively as an include. Therefore I would like to throw an error instead of executing it when it's accessed directly by typing in the URL instead of being included.</p>
  
  <p>Basically I need to do a check as follows in the php file:</p>
  
  <pre><code>if ( $REQUEST_URL == $URL_OF_CURRENT_PAGE ) die ("Direct access not premitted");
  </code></pre>
  
  <p>Is there an easy way to do this?</p>