forked from vikassinghv34/Book_publish_Management_System
-
Notifications
You must be signed in to change notification settings - Fork 0
/
reset.php
45 lines (41 loc) · 1.31 KB
/
reset.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
// include('header.php');
session_start();
include('conn.php');
if (isset($_GET['token']) && isset($_POST['submit'])) {
$token = $_GET['token'];
$pwd = mysqli_real_escape_string($conn, $_POST['pwd']);
$cfpwd = mysqli_real_escape_string($conn, $_POST['cfpwd']);
if ($pwd === $cfpwd) {
$updatequery = "update users set userEmailStatus='active', userPassword='$pwd' where userVerificationCode='$token'";
$query = mysqli_query($conn, $updatequery);
if ($query) {
if (isset($_SESSION['msg'])) {
$_SESSION['msg'] = "Password reseted successfully";
header('location: login.php');
} else {
$_SESSION['msg'] = "You are logged out";
header('location: login.php');
}
} else {
$_SESSION['msg'] = "Account not updated";
header('location:signup.php');
}
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<form method="POST" action="">
<input type="text" id="pwd" name="pwd" placeholder="enter your password">
<input type="text" id="cfpwd" name="cfpwd" placeholder="enter your password again">
<button type="submit" name="submit">submit</button>
</form>
</body>
</html>