Codeigniter 在页面刷新之前,当我们点击忘记按钮时,相同的电子邮件id必须以第二种形式存在

Codeigniter 在页面刷新之前,当我们点击忘记按钮时,相同的电子邮件id必须以第二种形式存在,codeigniter,pgp,Codeigniter,Pgp,控制器代码 公共函数ResetPassword(){ 型号代码 public function resetpassword($user) { $new_password = $this->input->post('newpassword'); $this->db->set('password',$new_password); $this->db->where('email',$user );

控制器代码 公共函数ResetPassword(){

型号代码

public function resetpassword($user) {


        $new_password = $this->input->post('newpassword');
        $this->db->set('password',$new_password);
        $this->db->where('email',$user );
        $this->db->update('supplier_registration');
}
 public function resetpasswordd($user) {
       $new_password = $this->input->post('newpassword');
        $this->db->set('password',$new_password );
        $this->db->where('email',$user);
        $this->db->update('customer_registration'); 

    }
<form action="<?php echo base_url(); ?>Index.php/Login_cntrl/ResetPassword" method="POST">
    <div class="field-wrap">
        <input type="text" name="emaill" id="emaill" placeholder="Enter your Mobile/Email Address" value="<?php echo $this->session->userdata('findemaill'); ?>" autocomplete="off" id="forgot-email"/>

    </div>

    <div class="field-wrap">
        <input type="text" name="otp" id="otp" placeholder="Enter OTP" value="<?php echo set_value('otp'); ?>"/>
         <span class="text-danger"><?php echo form_error('otp'); ?></span>
    </div>
      <?php    echo $this->session->flashdata('passwordmissmatch'); ?>
    <div class="field-wrap">
        <input type="text" name="newpassword" id="newpassword" placeholder="Enter new Password" value="<?php echo set_value('newpassword'); ?>"/>
          <span class="text-danger"><?php echo form_error('newpassword'); ?></span>
    </div>
    <div class="field-wrap">
        <input type="text" name="confirmpassword" id="confirmpassword" placeholder="Re-enter new Password" value="<?php echo set_value('confirmpassword'); ?>"/>
         <span class="text-danger"><?php echo form_error('confirmpassword'); ?></span>
    </div>

    <div class="field-wrap">
        <button type="submit" name="resubmit" id="resubmit" class="btn btn-submit">submit</button>
    </div>
<?php    echo $this->session->flashdata('success_msg'); ?>



    <div class="field-wrap">
        <a href="javascript:void(0)" class="btn-show-login btn btn-link btn-nobg" >Back</a>
    </div>

</form>
查看页面

public function resetpassword($user) {


        $new_password = $this->input->post('newpassword');
        $this->db->set('password',$new_password);
        $this->db->where('email',$user );
        $this->db->update('supplier_registration');
}
 public function resetpasswordd($user) {
       $new_password = $this->input->post('newpassword');
        $this->db->set('password',$new_password );
        $this->db->where('email',$user);
        $this->db->update('customer_registration'); 

    }
<form action="<?php echo base_url(); ?>Index.php/Login_cntrl/ResetPassword" method="POST">
    <div class="field-wrap">
        <input type="text" name="emaill" id="emaill" placeholder="Enter your Mobile/Email Address" value="<?php echo $this->session->userdata('findemaill'); ?>" autocomplete="off" id="forgot-email"/>

    </div>

    <div class="field-wrap">
        <input type="text" name="otp" id="otp" placeholder="Enter OTP" value="<?php echo set_value('otp'); ?>"/>
         <span class="text-danger"><?php echo form_error('otp'); ?></span>
    </div>
      <?php    echo $this->session->flashdata('passwordmissmatch'); ?>
    <div class="field-wrap">
        <input type="text" name="newpassword" id="newpassword" placeholder="Enter new Password" value="<?php echo set_value('newpassword'); ?>"/>
          <span class="text-danger"><?php echo form_error('newpassword'); ?></span>
    </div>
    <div class="field-wrap">
        <input type="text" name="confirmpassword" id="confirmpassword" placeholder="Re-enter new Password" value="<?php echo set_value('confirmpassword'); ?>"/>
         <span class="text-danger"><?php echo form_error('confirmpassword'); ?></span>
    </div>

    <div class="field-wrap">
        <button type="submit" name="resubmit" id="resubmit" class="btn btn-submit">submit</button>
    </div>
<?php    echo $this->session->flashdata('success_msg'); ?>



    <div class="field-wrap">
        <a href="javascript:void(0)" class="btn-show-login btn btn-link btn-nobg" >Back</a>
    </div>

</form>

您可以使用jquery进行以下操作:

$('.forgotLink').click(function (e) {
       e.preventDefault();
       window.location = $(this).attr('href') + '?email=' + encodeURIComponent($('#email').val());
    });

您可以使用jquery进行以下操作:

$('.forgotLink').click(function (e) {
       e.preventDefault();
       window.location = $(this).attr('href') + '?email=' + encodeURIComponent($('#email').val());
    });

使用jquery,当用户单击忘记链接时,获取电子邮件并生成链接,如
www.example.com?email=email
,然后通过
窗口重定向到下一页。位置
我没有收到,请将代码发送给我使用jquery,当用户单击忘记链接时,获取电子邮件并生成链接,如
www.example.com?email=email
和重读通过
窗口连接到下一页。位置
我没有收到请将代码发送给我我尝试了你的代码。但是,它没有按照我的要求正常工作我的要求是没有刷新页面第一个表单电子邮件id在单击忘记链接后,它应该以第二个表单显示相同的电子邮件id你的两个表单在同一页或其他单独的页面上页面?单独的表单,上面显示的两个表单请仔细查看我上面的表单将满足您的要求,在您的ResetController方法中,只需使用
$email=$this->input->get('email');
,它将从url获取电子邮件,然后像
$this->load->view('reset',$email');
和在输入电子邮件框中回显
值=""
。希望您理解。我尝试了您的代码。但是,它没有按照我的要求正常工作。我的要求是不刷新页面第一个表单电子邮件id单击“忘记”链接后,它应该在第二个表单中显示相同的电子邮件id。您的两个表单位于同一页面或其他单独页面上?单独的表单,上面显示的两个表单请转到虽然上述内容可以满足您的要求,但在您的ResetController方法中,只需使用
$email=$this->input->get('email');
,它将从url获取电子邮件,然后像
$this->load->view('reset',$email');
和在输入电子邮件框中回音
value=”“
,希望您理解