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.

0 0 vote
Article Rating
Notify of
1 Comment
Newest Most Voted
Inline Feedbacks
View all comments
1 year ago

Can you tell me how to validate a pan card , a valid card is like this ABCDE1234U
Where 5 characters are upper character next 4 character are number and last one again a upper character. Protection Status
Would love your thoughts, please comment.x