<?php function doforget()
{
$this->load->helper('url');
$email= $_POST['email'];
$q = $this->db->query("select * from users where email='" . $email . "'");
if ($q->num_rows > 0) {
$r = $q->result();
$user=$r[0];
$this->resetpassword($user);
$info= "Password has been reset and has been sent to email id: ". $email;
redirect('/index.php/login/forget?info=' . $info, 'refresh');
}
$error= "The email id you entered not found on our database ";
redirect('/index.php/login/forget?error=' . $error, 'refresh'); } ?>
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title></title> </head> <body> <p> <?php echo "<br/>"; ?> <a href="index.php">Home</a> </p> </body> </html>