PHP only allow server to access a PHP file
<p>I have three pages:</p>

<pre><code>index.html
getjavascript.php?id=index
index.js
</code></pre>

<p>index.html includes the script </p>

<pre><code>'getjavascript.php?id=index'
</code></pre>

<p>and getjavascript dynamically gets the script index.js.</p>

<p>Is there any way to prevent external users from directly accessing </p>

<pre><code>getjavascript.php 
</code></pre>

<p>using PHP? </p>

<p>index.js is in a hidden location.</p>

<p>Thanks,</p>
