I read up that sometimes require_once() still will reload a script file or w/e sometimes. Should I do something like this to prevent overhead?
Is this reasonable or no?
Also, to stop people from accessing ( not using .htaccess ) other scripts then desired, like the above mentioned library file...
Or should I redirect the user to index.php???
Code:
// Script file
if ( isset(FILE_LIB) ) exit; // Prevent double loading
define('FILE_LIB', 1);
...
...
Also, to stop people from accessing ( not using .htaccess ) other scripts then desired, like the above mentioned library file...
Code:
// index.php
define('MY_SCRIPT', 1);
// library.php
if ( !isset(MY_SCRIPT) ) exit;
Comment