我遇到以下错误遇到未捕获的异常
类型:错误
消息:调用未定义的函数random_string()
文件名:C:\ xampp \ htdocs \ HerbalCebu \ application \ controllers \ login.php
行号:128
回溯:
文件:C:\ xampp \ htdocs \ HerbalCebu \ index.php行:315功能:require_once,
当我想生成一个随机字符串时,它将作为用户的临时密码放置
这是我的控制器
function forgot_password()
{
$this->form_validation->set_rules('emailpass', 'emailpass', 'trim|required');
if($this->form_validation->run() == FALSE)
{
$this->load->view('Login/modal_forgot');
$this->load->view('CustTemplate/header');
$this->load->view('Login/Login');
$this->load->view('CustTemplate/footer');
}else{
$password = ('alpha', 8);
$data = array('password'=>md5($password));
$this->db->where('email',$this->input->post('emailpass'));
$this->db->update('users',$data);
$this->session->set_flashdata('message','here is your new password: <mark>'.$password.'</mark><br> please login now and change the given password');
redirect(base_url('login'));
}
}
public function check_email($password)
{
$email = $this->input->post('emailpass');
$result = $this->queries_login->get_email($email);
if($result)
{ …Run Code Online (Sandbox Code Playgroud)