public function add_new(){
$password = $this->input->post('password', TRUE);
echo $password;**nothing display**
$email= $this->input->post('email', TRUE);
echo $email;**nothing display**
$salt = $this->password_encrypt->genRndSalt();
$name = $this->input->post('store_name', TRUE);
$owner = $this->input->post('auth_person', TRUE);
$personal_email = $this->input->post('personal_email', TRUE);
$phone= $this->input->post('phone', TRUE);
$password = $this->password_encrypt->encryptUserPwd( $this->input->post('password'),$salt);
echo $password;**display encrypted password**
$array = array('email'=>$email,'password'=>$password,'salt'=>$salt,'store_name'=>$name,'store_owner'=>$owner ,'personal_email'=>$personal_email,'phone_number'=>$phone);
$result = $this->register_model->add_user($array);**this will be work;**
if($result == 1){
echo 1;
}else if($result == 0){
echo 0;
}
$this->function1($email); **not get value $email**
}
在register_model
我可以阅读变量电子邮件。
$email=$array['email'];
但是这里$this->function1($email);
没有电子邮件的价值。
但 $password = $this->password_encrypt->encryptUserPwd( $this->input->post('password'),$salt);
后,此行 echo $ password; 显示加密密码。
正确更新数据库 $this->register_model->add_user($array);//this will be work;
我想在function1($email);
函数中调用函数add_new()
。
功能1:
public function function1($a){
//$data['email'] =array['email'];
echo $a;
$data['email'] = $a;
$this->load->view('view1',$data);
}