-
Notifications
You must be signed in to change notification settings - Fork 0
/
edit_profile.php
62 lines (52 loc) · 2.21 KB
/
edit_profile.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
<?php
require_once "../includes/db_handler.inc.php";
require_once "../includes/config_session.inc.php";
require_once "../models/edit_profile.inc.php";
require_once "../views/edit_profile.inc.php";
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Quirx - My Profile</title>
<link rel="stylesheet" href="../css/global.css" />
<link rel="stylesheet" href="../css/profile.css" />
<link rel="stylesheet" href="../css/navbar.css" />
</head>
<body>
<?php include_once('../includes/components/navbar.inc.php') ?>
<?php
// check if user is logged in
if (!isset($_SESSION['user_id'])) {
// if not, redirect to login page
header('Location: ./login.php');
exit();
}
$current_user = get_current_user_details($pdo, $_SESSION['user_id'])
?>
<main class="profile">
<h1 class="profile__title">Edit your profile <br>
<span class="subheading">Enter values you want to update</span>
</h1>
<form action="../includes/edit_profile.inc.php" class="profile__form" method="post" enctype="multipart/form-data">
<input type="text" name="name" placeholder="<?php
echo "Name: " . $current_user['full_name'];
?>">
<input type=" email" name="email" placeholder="<?php
echo "Email: " . $current_user['email'];
?>">
<input type="text" name="username" placeholder="<?php
echo "Username: " . $current_user['username'];
?>">
<label for="pfp" class="btn">Upload or change profile picture</label>
<input type="file" name="pfp">
<button type="submit" class="profile__btn profile__btn--edit">Update</button>
</form>
</main>
<?php
check_and_print_edit_profile_errors();
?>
<script src="../js/close_modal.js"></script>
</body>
</html>