CodeIgniter Forums

Full Version: accesing model from browser?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Out of curiosity I tried to open my model through the browser:

http://www.domain.com/application/models/My_model.php

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.
http://www.codeigniter.com/user_guide/in...index.html
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.