-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAccountUpdate.php
More file actions
81 lines (69 loc) · 2.99 KB
/
AccountUpdate.php
File metadata and controls
81 lines (69 loc) · 2.99 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
77
78
79
80
81
<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html lang="en">
<head>
<?php
include "./includes/header.php"
?>
</head>
<body>
<?php
include "./includes/nav.php"
?>
<header class="page-header">
<h1>Profile Page</h1>
</header>
<?php
if (isset($_SESSION['memberid'])) {
$memberid = $_SESSION['memberid']; //for later use
}
else {
echo "<meta http-equiv='refresh' content='0.1;url=https://luxauto.studio/login.php'>";
//Redirect to login page first
//return
}
$config = parse_ini_file('../../private/db-config.ini');
$conn = new mysqli($config['servername'], $config['username'], $config['password'], "project1004");
if ($conn->connect_error) {
$errorMsg = "Connection failed: " . $conn->connect_error;
echo $errorMsg;
$success = false;
}
else {
$stmt = $conn->prepare("SELECT * FROM members where member_id = ?");
$stmt->bind_param("i", $memberid);
$stmt->execute();
$result = $stmt->get_result();
while($row = $result->fetch_assoc()) {
$first_name = $row["first_name"];
$last_name = $row["last_name"];
$email = $row["email"];
//add these to a json array then show on display?
}
}
?>
<div id="update" class="auth-container active">
<br>
<br>
<p class="auth-header">Update Account</p>
<form action="UpdateProcess.php" method="post">
<label for="first_name">First Name:</label>
<input aria-label="first name" type="text" class="inputs" required placeholder="First Name" value= "<?php echo $first_name;?>" id="first_name"/>
<label for="last_name">Last Name:</label>
<input aria-label="last_name" type="text" class="inputs" required placeholder="Last Name" value="<?php echo $last_name;?>" id="last_name"/>
<label for="email">Email:</label>
<input aria-label="email" type="email" class="inputs" required placeholder="Email Address" value="<?php echo $email;?>" id="email"/>
<label for="password">Password:</label>
<input aria-label="password" type="password" class="inputs" required placeholder="Password" id="password" minlength="8" maxlength="20"/>
<label for="password_confirm">Re-enter Password:</label>
<input aria-label="retype password" type="password" class="inputs" required placeholder="Re-enter Password" id="password_confirm" minlength="8" maxlength="20"/><br>
<button class="auth-submit">Update</button><br>
<hr>
</form>
</div>
</body>
</html>