Welcome Guest, Not a member yet? Register   Sign In
accesing model from browser?

Out of curiosity I tried to open my model through the browser:


and instead of getting some "not found" or "no access" error I got:

Fatal error: Class 'CI_Model' not found in /home/xxx/public_html/application/models/My_model.php on line 3

is this normal, or did I something wrong during installation?

It is normal, but it is not good that you can access models from your browser.

Quote:For the best security, both the system and any application folders should be placed above web root so that they are not directly accessible via a browser. By default, .htaccess files are included in each folder to help prevent direct access, but it is best to remove them from public access entirely in case the web server configuration changes or doesn’t abide by the .htaccess.

for PHP and codeigniter there is an order to how things are loaded if they are going to work. essentially all links go through the main index.php file first, and then are 'routed' to the appropriate controller, which then calls the models.

Theme © iAndrew 2016 - Forum software by © MyBB