-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnewpassrd.php
executable file
·82 lines (72 loc) · 1.72 KB
/
newpassrd.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?php
session_start();
//$_SESSION["login"]="Doctor";
if(!isset($_SESSION['rand']))
header('Location:docregister.php');
?>
<!DOCTYPE html>
<html>
<head>
<title>SET</title>
<link rel="stylesheet" href="css/style.css">
<link rel="icon" type="image/png" href="medhelpblue.png">
</head>
<body>
<div class="wrapper">
<a href='index.php'>
<img src='Medhelp icon.png' style='width:10%;height:10%; '></a>
<div class="container">
<h1 style='font-size: 350%'><b>Set New Password</b></h1>
<form>
<span id='3' style="color: red"></span>
<br>
<input type="password" placeholder="New password" id="1" name="firstname" required>
<input type="password" placeholder="Confirm password" id="2" name="lastname" required>
<br><br>
<button type="button" onclick="f();">Submit</button>
<button type="reset">Reset</button>
</form>
</div>
<ul class="bg-bubbles">
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
</div>
<script>
function f(){
var xml=new XMLHttpRequest();
var a=document.getElementById('1').value.trim();
var b=document.getElementById('2').value.trim();
if(a=="" || b==""){
document.getElementById('3').innerHTML="Please fill the Password";
return;
}
else if(a!=b){
document.getElementById('3').innerHTML="Passwords don't match";
return;
}
xml.onreadystatechange=function(){
if(this.readyState==4 && this.status==200){
if(this.responseText==1)
window.location.href = "as_doc.php";
if(this.responseText==2)
document.getElementById('3').innerHTML="Password not updated";
}
};
xml.open("POST","setpassword.php?firstname="+a,true);
xml.send();
}
</script>
</body>
</html>