Hi,
I have done some research and found a way to prevent access to included files using the below code:
orPHP Code:if (count(get_included_files()) == 1) exit('Access denied.');
Is this a good or secure way to do prevent direct access to files that are not meant to be accessed directly such as PHP script files? Do you have any better alternative methods?PHP Code:if (count(get_included_files()) == 1) header('Location: /* home page or login page */');



Reply With Quote




Bookmarks