i am new to codeIgniter and am using version 1.7. can somebody give me sample scripts to illustrate MVC. use login/user authentication from database typically using username and password. after logging, user should be redirected to certain page if invalid credentials, display error message. give comments on your logic.

Write the function that checks the session that the user was already login or not. If the user was not already login, redirect to login page, otherwise, redirect to the specific page. With my opinion, write the authentication function in the library and check the user login, and use 'autoload' method to load this library when the page was requested. Then, run this function in the constructor of every controller. So, the user cannot see the pages without login.

Also, go to nettuts+. They've video tutorials for CodeIgniter.

Hope this help !

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.