if(isset($_SERVER['REMOTE_ADDR']))
{
die();
}
If you have a script that needs to run from the command line (say, via cron), but for some dumb reason needs to reside in a publicly accessible location (e.g. via the web), use the above code at the very start of your script. The only time that particular variable exists is when someone is connecting over the web. Command line execution doesn't create it.
test
test @ 08:20:56 PM, Sunday, October 9, 2011