quiettech Posted April 9, 2008 Share Posted April 9, 2008 Hello all, I'm wanting to secure a script from any other access than that of a require(). That is, the script cannot be ran directly, only as part of an include. Currently I have only the script chmod to 600. But I would like top go that extra mile in securing this code. I believe this is done through .htaccess but am failing to find the proper syntax. Link to comment https://forums.phpfreaks.com/topic/100289-solved-securing-a-script-from-direct-access/ Share on other sites More sharing options...
uniflare Posted April 9, 2008 Share Posted April 9, 2008 all you need is: defined('INCLUDED_CONSTANT'); as an if statement at the top of the script you want securing. ---- then just put define("INCLUDED_CONSTANT",true); at the top of your index php file. hope this helps, Link to comment https://forums.phpfreaks.com/topic/100289-solved-securing-a-script-from-direct-access/#findComment-512806 Share on other sites More sharing options...
quiettech Posted April 9, 2008 Author Share Posted April 9, 2008 That simple. Thanks uniflare. Link to comment https://forums.phpfreaks.com/topic/100289-solved-securing-a-script-from-direct-access/#findComment-512816 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.