Welcome Guest, Not a member yet? Register   Sign In
how to create a login / registration system
#1

(This post was last modified: 03-28-2015, 07:45 AM by ciadmin.)

Hi, thank you for the Oracle DB thread.
Now i just want to know how to create a login / registration system using CI. Hope that anyone can teach me here..
Reply
#2

Have a look at Ion Auth, an existing login/registration system built for CI.
You will learn that it involves:
- a controller that collects data for displaying it on forms and pages, and also process the data coming back from forms.
- a library with common functions e.g. to check if a user is member of a certain group
- a model with database functions (get, save, update, delete)
- a number of views, e.g. a login form
- a number of configuration files, e.g. to make the system multilingual
- a table in your database that holds the registered users' data
- another table that holds the group names
- another table that holds the relationships between users and groups
Make the library globally available by putting it in the autoload.php config file.
Also, make use of the session driver to make all your pages remember the logged in user's id.

Direct your user to a login form.
After submitting the form you check if the user's name (or email) and password are correct. If so, store the user's id in the session data.
If the user opens a url on your site which has limited access (only for a certain group), you check if the user's id is in this group. If not, you deny access to the page.
Reply
#3

hi,

You might want to have a look at this thread to get some more solutions.
Reply
#4

Creating a login/registration system can be a complex task, but here are some general steps that can be followed:

1. Determine the requirements: The first step is to determine the requirements of the login/registration system. Consider things like the types of users that will be accessing the system, the security requirements, and any other specific requirements that need to be met.

2. Design the database: Once the requirements are determined, design the database that will store the user data. This database should include fields for the user's username, password, and any other relevant information.

3. Create the registration page: The registration page should be designed to collect all the necessary information from the user. This page should include fields for the user's username, password, and any other required information.

4. Implement user authentication: Once the user has registered, the system should authenticate their credentials when they attempt to log in. This is typically done by comparing the entered username and password to the values stored in the database.

5. Create a login page: The login page should be designed to allow users to enter their username and password. If the entered credentials are valid, the user should be granted access to the system.

6. Implement security measures: It's important to implement security measures to protect the user's data. This includes things like encrypting passwords, limiting login attempts, and using HTTPS to encrypt data in transit.

7. Test the system: Finally, test the system thoroughly to ensure that it works as expected and that all requirements are met.

Overall, creating a login/registration system can be complex, but by following these steps, you can create a secure and functional system that meets your requirements.
Hermina Andrews,
Reply




Theme © iAndrew 2016 - Forum software by © MyBB