How would I allow a script to run ONLY IF it was accessed by another script on the SAME server
<p>Recently I created a script that accesses another script to run it. The only way the second script will run, is if it is accessed from the same server. To accomplish this I've made a simple <code>if ($_SERVER['REMOTE_ADDR'] == "XXX.XXX.XXX.XXX") {</code></p>

<p>(Obviously the <code>XXX.XXX.XXX.XXX</code> is replaced with my server's IP.)</p>

<p>However, I'd like the script to be more portable, so I want it to somehow detect the IP of the same server or something.</p>

<p>Suggestions? Or is this even possible?</p>
