<html>
<head>
    <meta charset="utf-8"/>
   <title>PRAYATNA - User Reset Password</title>
	<link rel="stylesheet" href="user_table.css">
	<link href="https://fonts.googleapis.com/css2?family=Asap+Condensed&display=swap" rel="stylesheet">
	<link href="https://fonts.googleapis.com/css2?family=Orbitron:wght@500&display=swap" rel="stylesheet"><link href="https://fonts.googleapis.com/css2?family=Arizonia&display=swap" rel="stylesheet">
</head>
<body>
<?php
    require('db.php');
    session_start();
	//echo $_POST['submitreset']." - ".$_POST['selectreset'];
	//echo "entered";
if(isset($_POST['submitreset'])){
	//echo "entered1";
  if(isset($_POST['answer'])){
	//echo "entered2";

	$mobile=$_SESSION['mobile'];
	$answer=$_POST['answer'];
	$password=$_POST['password'];

//	  echo $mobile." ".$answer." ".$password;
	$query = "UPDATE  `user` SET password = '" . md5($password) . "' WHERE mobile='$mobile' AND answer='" . md5($answer) . "'";
	$result = mysqli_query($con, $query) or die(mysql_error());
	//$rows = mysqli_num_rows($result);
	//if ($rows == 1) {
	//if(1){
		//}	
	}
  }
  header("Location: user_login.php");
?>
</body>
</html>