[eluser]chmod[/eluser]
When I use callback__check_username_and_password in rules,only ONE parameter can pass to the custom function. I use a array,but the same to it.
like these:
controller:
-------------------------
function _check_pay_pointnum($check_pay_pointnum){
print_r($check_pay_pointnum);
exit;
$result = $this->pay_model->_check_pay_pointnum($check_pay_pointnum);
if ($result){
return TRUE;
}else{
return FALSE;
}
}
function index(){
if ($this->input->post('submit')){
//check post data
$username = $this->input->post('username');
$reusername = $this->input->post('reusername');
$pointnum = $this->input->post('point');
$cardnum = $this->input->post('cardnum');
$cardpass = $this->input->post('cardpass');
$paycardmd5pass = md5($cardpass);
$pay_type = $this->session->userdata('pay_type');
$check_pay_pointnum = array('pointnum' => $pointnum,'pay_type' =>$pay_type );
$rules['username'] = "trim|required|matches[reusername]|xss_clean|callback__check_username_exist";
$rules['reusername'] = "trim|required|xss_clean";
$rules['point'] = "trim|required|callback__check_pay_pointnum";
$rules['cardnum'] = "trim|required|alpha_numeric|callback__check_cardnum_cardpass";
$rules['cardpass'] = "trim|required|alpha_numeric";
....
}
If I can not pass two parmeters,I will use session data,
and pass one parameter in callback function.
but the thing is not a good idea.Isn't it?
Is there any way to do it?