-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprofile.php
More file actions
76 lines (68 loc) · 2.17 KB
/
Copy pathprofile.php
File metadata and controls
76 lines (68 loc) · 2.17 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
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
<?php
require "connect.php";
// If the user is not logged in or not an admin, they should be redirected to the homepage
if ($_SESSION["logged"]) {
$sql = "SELECT * FROM userdata WHERE username = ?;";
$users = $pdo->prepare($sql);
$users->execute([$_SESSION["username"]]);
$user = $users->fetch();
$name = $_SESSION["username"];
$logged = true;
} else {
$name = "Account";
$logged = false;
header("Location: index.php");
}
$sql = "SELECT * FROM userdata WHERE id=?;";
$userlist = $pdo->prepare($sql);
$userlist->execute([$_SESSION["id"]]);
$user = $userlist->fetch();
?>
<!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">
<title>Gebruiker bewerken</title>
<link rel="stylesheet" href="style.css">
<script src="script.js" defer></script>
<style>
#pf {
padding: 14px 16px;
background-color: #00695C;
}
#profile {
padding: 14px 16px;
background-color: #00695C;
color: white;
}
</style>
</head>
<body>
<?php require "nav.php" ?>
<div class="tablediv noborder">
<form action="editprofiledone.php" method="post" enctype="multipart/form-data">
<input type="number" name="id" id="id" class="invisible" value="<?= $_SESSION["id"] ?>">
<table>
<tr>
<td>Gebruikersnaam</td>
<td><input type="text" name="username" id="username" value="<?= $user["username"] ?>"></td>
</tr>
<tr>
<td>Wachtwoord</td>
<td><input type="password" name="password" id="pwd"></td>
</tr>
<tr>
<td>Profielfoto</td>
<td><input type="file" name="foto" id="foto" value="<?= $user["pfp"] ?>"></td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Wijzig"></td>
</tr>
</table>
</form>
</div>
</body>
</html>