【问题标题】:How to verify "Forgot password" feature locally in CodeIgniter [duplicate]如何在 CodeIgniter 中本地验证“忘记密码”功能 [重复]
【发布时间】: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


【解决方案1】:
<a href='".$_SERVER['server_name']."user/pass_confirmation/$encrypted_string/$email'>

使用服务器名称。

【讨论】:

  • 在你本地的$_SERVER['server_name'] 会输出localhost
猜你喜欢
  • 2017-11-16
  • 2013-11-07
  • 2020-04-08
  • 2013-12-09
  • 2011-10-19
  • 2011-09-28
  • 1970-01-01
  • 2015-10-29
  • 2012-12-20
相关资源
最近更新 更多