【发布时间】:2015-11-02 00:28:55
【问题描述】:
我在本地忘记了密码。所以我无法识别它是否正确。
我可以使用链接验证吗
<a href='".base_url()."user/pass_confirmation/$encrypted_string/$email'>
我的控制器功能
function email_check()
{
$email=$this->input->post('email');
$data = array(
'user_email' =>$email,
);
$result = $this->UM->email_verify($data);
if($result)
{
echo $result;
$date = date(Y-m-d);
$string = $email."-".$date;
$encrypted_string = md5($string);
echo $encrypted_string;
$res=$this->UM->insert_key($encrypted_string,$result);
$this->email->from('admin@b-scripts.com');
$this->email->to($this->input->post('email'));
$this->email->subject('Confirmation to reset password');
$message = "<p>This email has been sent as a request to reset our password</p></br>";
$message .= "<p><a href='".base_url()."user/pass_confirmation/$encrypted_string/$email'>'>Click here </a>if you want to reset your password,
if not, then ignore</p>";
$this->email->message($message);
$this->email->send();
redirect(base_url()."user/forgot_pass");
}
else
{
redirect(base_url()."user/forgot_pass");
}
}
【问题讨论】:
-
这不是重复的,我问的是不同的
标签: php codeigniter anchor forgot-password