<p>I want to make sure people can't type the name of a PHP script in the URL and run it. What's the best way of doing this?</p>

<p>I could set a variable in the file that will be including this file, and then check that variable in the file being included, but is there an easier way?</p>

You could check the URI and see if that file is being called with `
```
```
$_SERVER['SCRIPT_FILENAME']
```
```
or you could move the file outside the public folder, this is a better solution.