-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathforgot_password_backend.php
More file actions
47 lines (31 loc) · 1.31 KB
/
forgot_password_backend.php
File metadata and controls
47 lines (31 loc) · 1.31 KB
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
46
47
<?php
$con = mysqli_connect('localhost','root','','COVID');
if(isset($_POST['flogin'])){
$f_name = $_POST['f_name'];
$f_pass = $_POST['f_pwd'];
$sql = "select * from LOGIN where USERNAME like '$f_name'";
$result = mysqli_query($con, $sql);
$row = mysqli_num_rows($result);
if($row >= 1){
$sql = "update LOGIN set PASSWORD = '$f_pass' where USERNAME like '$f_name'";
$result = mysqli_query($con, $sql);
$sql = "select * from HOSPITAL_INFO where NAME like '$f_name'";
$result = mysqli_query($con, $sql);
$row = mysqli_num_rows($result);
if($row >= 1){
$sql = "update HOSPITAL_INFO set PASSWORD = '$f_pass' where NAME like '$f_name'";
$result = mysqli_query($con, $sql);
}
$sql = "select * from UNIVERSITY_INFO where NAME like '$f_name'";
$result = mysqli_query($con, $sql);
$row = mysqli_num_rows($result);
if($row >= 1){
$sql = "update UNIVERSITY_INFO set PASSWORD = '$f_pass' where NAME like '$f_name'";
$result = mysqli_query($con, $sql);
}
header("refresh:1;url=login.php");
}else{
echo "wrong user name";
}
}
?>