file access
Moderator: General Moderators
-
SidewinderX
- Forum Contributor
- Posts: 407
- Joined: Fri Jul 16, 2004 9:04 pm
- Location: NY
file access
sweet, my script finally works with no errors! But now that the script is done i would like to fix some security issues. My first question is how do i restrict access to a file? for example config.php. Although the only data in there is stored as variables I would like it so if someone points to the file they get a message like "Sorry, You cannot access this file directley."
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
what I do on my sites is
Code: Select all
define('IN_SITE',true);
include('config.php');Code: Select all
if !defined('IN_SITE') {
exit('You cannot access this file directly');
}