//on index page
define ('SysFile', '1');
//on every page that is to only be viewed if accessed via index.php before EVERYTHING...
if (SysFile != '1')
die ('Attempting to access Restricted file!');
that will check if SysFile = 1, if SysFile isn't defined, script dies.
You could do a header('Location: h*ttp://site.com/index.php instead of die()
something i just thought of... writing a little script to log attempts to access restricted files. http_refferer, ip, time , etc... so you can see when, who... i'll post something about this later, cause i just had some crazy ideas heh
"Knowledge is power. Abuse it."~Evulness
My portfolio: www.evularts.com
Last edited by Evulness : 04-24-2008 at 02:08 PM.
Reason: link went wrong
Well, if those are both on the same page, then ACCESSLEVEL is true, and therefore the if statement doesn't execute.
Just a note for security purposes, if you want to make sure that nobody is going to view your page, you may want to add exit() or die() after the header() statement. Good ole lynx doesn't care about your header's if it doesn't want to.