<?php
include('database.php');
session_start();


if(isset($_POST['submit']))
{
	$password = mysqli_real_escape_string($connection, $_POST['password']);
	$email = mysqli_real_escape_string($connection, $_POST['email']);
	
    $query ="UPDATE users SET password='$password' WHERE email='$email'";
    $query_run = mysqli_query($connection, $query);
    if($query_run)
    {
		$_SESSION['status'] = "<p style='padding:15px; background: #1a1849; color: #fff; border-radius:10px;'>Your password has been changed </p>";
		header('location:../signin.php');
	}
    else
    {
		$_SESSION['status'] = "error.. address not linked";
		header('location:../signin.php');
	}		
}

?>