codeigniter表单验证回调函数不起作用 [英] codeigniter form validation callback functions not working
问题描述
codeigniter表单验证回调函数不工作
数组(
'field'=>'密码',
'label'=>'密码',
'规则'=>'trim | required | min_length [6] | max_length [100] | xss_clean | prep_for_form |匹配[confirm_password ] | callback_encrypte_pass'
),
数组(
'field'=>'confirm_password',
'label'=>'确认密码',
'规则'=>'trim | required | min_length [6] | max_length [100] | xss_clean | prep_for_form | callback_encrypte_pass'
)
和encrypte_pass函数
公共功能encrypte_pass($ pass){
返回md5($ pass);
}
当我用md5替换callback_encrypte_pass时喜欢那个
'规则'=> 'trim | required | min_length [6] | max_length [100] | xss_clean | prep_for_form |匹配[confirm_password] | md5'
密码仍未加密
codeigniter form validation callback functions not working
array(
'field' => 'password',
'label' => 'password',
'rules' => 'trim|required|min_length[6]|max_length[100]|xss_clean|prep_for_form|matches[confirm_password]|callback_encrypte_pass'
),
array(
'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
推荐答案
pass){
返回md5(
pass) {
return md5(
pass);
}
当我用md5替换callback_encrypte_pass时
'规则'=> 'trim | required | min_length [6] | max_length [100] | xss_clean | prep_for_form |匹配[confirm_password] | 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
这篇关于codeigniter表单验证回调函数不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!