April 12, 2016 - VoIP Company | Web Development | Mobile App Development

We are exhibiting at Convergence India 2023, New Delhi, India, 27-29 March Book a Meeting

Custom form validation in CodeIgniter

In any website the main thing for form is validation. There are many ways for validation but one of most secure way it controller-side validation (server-side). CodeIgniter is having that feature available in-built. There are some basic steps to implement it but it won't have all validation available. So in this blog I will explain how we can add custom validation. Lets take example of I want to compare two dates: For this we need to add function in system/libraries/Form_validation.php. public function greater_than_date($str, $min) { $date1=strtotime($str); $date2=strtotime($min); return $date1 > $date2; }Now, we need to set custom message which need