<?php
include('../../connection.php');
?>



<html>
<body>
<form method="post" >    
    <br><center>RESET PASSWORD</center>
    <br><br>
<center>Enter User Name<input type="text" class="form-control" name="a1"></center>
<br>
<center>Enter New Password<input type="text" class="form-control" name="a2"></center>
<br>

<center><input type="submit" name="s"></center>
</form>

<?php 
if (isset($_POST['s']))
{
    $username=$_POST['a1'];
	$password=md5($_POST['a2']);

	$sql=mysqli_query($db,"select * from tbl_login where username='$username'  ");
    if (mysqli_num_rows($sql)>0)
    {
	$ins=mysqli_query($db,"update tbl_login set password='$password' ");
    
    msg("Successfully updated new password","login.php");
    }
    else 
    {
        msg('Enter Valid User Name','forget_password.php'); 
    }
}
?>

</body>

</html>