-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathset-password.php
More file actions
50 lines (45 loc) · 1.16 KB
/
set-password.php
File metadata and controls
50 lines (45 loc) · 1.16 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
48
49
<!DOCTYPE html>
<?php
include_once 'connection-script.php';
?>
<html>
<head>
<meta charset="utf-8">
<title>Set Password</title>
<head>
<link href='//fonts.googleapis.com/css?family=Comfortaa' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
<div id="header" class="header"
<ul><p><a href="homepage_student.php">NAME</a></p>
</div>
<div>
<h3>Enter the password you want to set</h3>
<form method="post">
<input type="password" id="password" placeholder="New password">
<input type="hidden" id="email" value="<?php $email=$_GET['email']; echo $email; ?>">
<button type="button" id="setpasswordbutton" value="Set Password" onclick="setnewpassword()">
</form>
</body>
</html>
<script>
function setnewpassword()
{
var password=$('#password').val();
var email=$('#email').val();
jQuery.ajax({
type: "POST",
url: "set-password-script.php",
data: 'email='+email+'&password='+password,
cache: false,
success: function(response)
{
if(response==1)
{
alert("Password set! You are good to go now.");
document.location.href="index.php";
}
})
}
</script>