Posts: 33
Threads: 13
Joined: Apr 2015
Reputation:
0
09-27-2015, 07:54 PM
defined('BASEPATH') OR exit('No direct script access allowed');
What is it ? and For What ? have Example is good ><
thank you
Posts: 4,380
Threads: 101
Joined: Oct 2014
Reputation:
146
If your BASEPATH is not defined by index.php then it will display the No direct script access allowed.
This is to keep un-wanted users out of your folders and files.
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
Posts: 33
Threads: 13
Joined: Apr 2015
Reputation:
0
09-27-2015, 09:38 PM
(This post was last modified: 09-27-2015, 09:38 PM by seasenx6.)
"This is to keep un-wanted users out of your folders and files."
you mean hacker will hack is difficult ?
Posts: 70
Threads: 2
Joined: Oct 2014
Reputation:
8
Normally every php file can be run which can reveal parts of your site or cause other unwanted output like error messages if that file isn't meant to be run from the web.
The line with BASEPATH prevents naughty people to get output from files that are only to be used by the framework like php files in your model and views folders.
Beware, this doesn't mean it makes your site unhackable!! It just maybe prevents some people from getting easy useful information which can be used for hacking your site.