Click here to Skip to main content
15,749,072 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
codeigniter form validation callback functions not working

'field' => 'password',
'label' => 'password',
'rules' => 'trim|required|min_length[6]|max_length[100]|xss_clean|prep_for_form|matches[confirm_password]|callback_encrypte_pass'
'field' => 'confirm_password',
'label' => 'confirm password',
'rules' => 'trim|required|min_length[6]|max_length[100]|xss_clean|prep_for_form|callback_encrypte_pass'

and the encrypte_pass function

public function encrypte_pass($pass) {
return md5($pass);


also when i replace callback_encrypte_pass with md5 like that

'rules' => 'trim|required|min_length[6]|max_length[100]|xss_clean|prep_for_form|matches[confirm_password]|md5'

the password still not encrypted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900