• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
accesing model from browser?

#1
Exclamation 
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?
Reply

#2
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
Do you want to write tests for your apps? Our book, CodeIgniter Testing Guide would help you.
Reply

#3
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.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.