Php CodeIgniter Server Side Form Validation Example

Today we are going to learn more about server side validation using php codeigniter framework.Follow the below steps to do the server side validations.

Server side validation is most secure way than client side validation, because client side validation can be bypass through script manipulation tools. Below example is simple user login form, We are going to validate the User Name and Password fields using CodeIgniter’s validation library.

set_rules() method is used to define the validation rules for the form fields. $this->form_validation->run() return Boolean value, TRUE on success and FALSE on failure.

Create Codeigniter Controller Class called – Home.php

Create a view Page called form_validation_demo.php

This is the default page of the application. Here we are going to validate the userform.

Finished 🙂

Hope this Tutorial is helpful to you, Please provide your comments if there is any issues.

I hope you like this Post, Please feel free to comment below, your suggestion and problems if you face - we are here to solve your problems.


I am Arjun from Hyderabad (India). I have been working as a software engineer from last 7+ years, and its my passion to learn new things and implement them as a practice. Aside from work, I likes gardening and spending time with pets. Protection Status