Smartlab Software logo

Prevent a PHP file from being directly accessed

A very nice way to prevent a PHP file from being directly accessed, such as an include file.

if(count(get_included_files()) == 1) exit("Direct access not permitted.");

***