-
Notifications
You must be signed in to change notification settings - Fork 0
/
profile.php
66 lines (51 loc) · 1.7 KB
/
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
63
64
65
66
<?php
@session_start();
@require_once("functions.php");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Van Street Eats</title>
<link href="css/normalize.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Domine|Josefin+Sans&display=swap" rel="stylesheet">
<link href="css/main.css" rel="stylesheet">
</head>
<body>
<!-- header section -->
<header class="box-head box">
<?php
include("header.php");
include("navmenu.php");
?>
</header>
<!--main content section-->
<!-- <h2 class="heading">Main Content</h2> -->
<div class="spacer"></div>
<section class="centered">
<?php
$connection;
$result;
if (isset($_SESSION["set_user"])) {
openConnection($connection);
getUser($connection, $result);
$user = mysqli_fetch_array($result);
$name = $user["username"];
} else {
$name = "please sign in, you shouldn't even see this because it means there's an error";
}
echo "<h1>".$name."'s user information</h1>";
// echo "<h2>details</h2>";
echo "<h3>email:</h3>";
echo "<p>".$user["email"]."</p>";
echo "<h3>preferred food region:</h3>";
echo "<p>".$user["e_pref"]."</p>";
echo "<h3>preferred food type:</h3>";
echo "<p>".$user["f_pref"]."</p>";
echo "<div class=\"spacer\"></div>";
echo "<a href=\"user_pref.php\">edit</a>";
closeConnection($connection, $result);
?>
</section>
</body>
</html>