Create registration form in codeigniter - phptpoint

Create registration form in codeigniter

/ins>

Create registration form in codeigniter

In this tutorial we will understand how to create simple registration form in CodeIgniter.
Before inserting Students data inside database we will check student email id is already exists then show error message
“User already exists” if not alrady exists then store information inside database.

We will use student table to save data.

This is student table structure

Table Name : student
student_id int primary key auto_increment
name char(50)
email varchar(100)
password varchar(100)
mobile bigint
course char(100)

Controller

Copy the below given code in your User Controller.
In this example we have not used proper model page , all database query wrote in Controller.

Registration View

Copy the below given code in your student_registration.php View Page.

Execute User Controller’s index method

Open your web browser and Pass : http://localhost/CodeIgniter/index.php/user/index

Output(Save Records if email id is not already exists)


Output(Show error “This user already exists”)