Welcome Guest, Not a member yet? Register   Sign In
Can I set a static ID/Password for a page ?
#1

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 ?
Reply
#2

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




Theme © iAndrew 2016 - Forum software by © MyBB