codingmasterRS Posted June 4, 2011 Share Posted June 4, 2011 Hi guys, Just trying to find an article that showed a script for PHP code that stopped files from being included unless from an approved PHP file. Worked something like this: index.php define('APPROVEDFILE'); included.php if not from approvedfile then exit(); Any help much appreciated, cheers in advance. Quote Link to comment https://forums.phpfreaks.com/topic/238372-scriptarticle/ Share on other sites More sharing options...
gizmola Posted June 4, 2011 Share Posted June 4, 2011 There's not much to it. Either set a variable or set a constant, as in your example. In the scripts that are included, you simply do this: if (!defined('APPROVEDFILE')) die('Disabled'); or if (!isset($approvedfile)) die('Disabled'); Quote Link to comment https://forums.phpfreaks.com/topic/238372-scriptarticle/#findComment-1225019 Share on other sites More sharing options...
codingmasterRS Posted June 4, 2011 Author Share Posted June 4, 2011 More trying to find the article as well, seemed to be a good PHP security article. Quote Link to comment https://forums.phpfreaks.com/topic/238372-scriptarticle/#findComment-1225022 Share on other sites More sharing options...
gizmola Posted June 4, 2011 Share Posted June 4, 2011 More trying to find the article as well, seemed to be a good PHP security article. I have no idea, that technique dates back ages ago. Quote Link to comment https://forums.phpfreaks.com/topic/238372-scriptarticle/#findComment-1225027 Share on other sites More sharing options...
codingmasterRS Posted June 4, 2011 Author Share Posted June 4, 2011 Do you know any other good articles then? Anyone please feel free to recommend. Quote Link to comment https://forums.phpfreaks.com/topic/238372-scriptarticle/#findComment-1225031 Share on other sites More sharing options...
codingmasterRS Posted June 5, 2011 Author Share Posted June 5, 2011 BUMP Quote Link to comment https://forums.phpfreaks.com/topic/238372-scriptarticle/#findComment-1225310 Share on other sites More sharing options...
Philip Posted June 5, 2011 Share Posted June 5, 2011 http://www.phpfreaks.com/tutorial/php-security Quote Link to comment https://forums.phpfreaks.com/topic/238372-scriptarticle/#findComment-1225364 Share on other sites More sharing options...
codingmasterRS Posted June 5, 2011 Author Share Posted June 5, 2011 Found it http://insanesecurity.info/blog/8-tips-for-a-secure-login-scriptadmin-panel Quote Link to comment https://forums.phpfreaks.com/topic/238372-scriptarticle/#findComment-1225392 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.