-
Notifications
You must be signed in to change notification settings - Fork 7
/
reset.php
executable file
·38 lines (36 loc) · 1.01 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
<?php
require_once ('Plans.php');
?><html>
<head>
<title>Reset Style Sheet</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body><center>
<?php
require ("functions-main.php");
if (isset($_POST['username'])) {
$dbh = db_connect();
if (User::checkPassword($_POST['username'], $_POST['password'])) {
$idcookie = get_item($dbh, "userid", "accounts", "username", $_POST['username']);
set_item($dbh, "display", "style", "1", "userid", $idcookie);
delete_item($dbh, "stylesheet", "userid", $idcookie);
echo "Your style sheet has been reset.";
} else {
echo "Invalid username or password";
}
db_disconnect($dbh);
} else {
?>
<a href="index.php">Back</a><br>
Reset style sheet for your account.
<form action="reset.php" method="post">
Username: <input type="text" name="username"><br>
Password: <input type="password" name="password"><br>
<input type="submit" value="Reset">
</form>
<?php
}
?>
</center>
</body>
</html>