• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can I set a static ID/Password for a page ?

I have some pages that I want to hide from users, and I just want to do very simple authentication. For example, I just hardcode an ID and a password in my header script, and requires users to enter ID and password to show the contents. Is it possible to do that with CodeIgniter ?

Absolutely. If you are looking for something simple, you can use CodeIgniter session library and check user login state in controller __construct method, if all controller methods should be protected, or in individual methods. If session state isn't available or is not set as successfully logged in, send user to login page, the return once your hard coded passwords was entered.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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