-
Notifications
You must be signed in to change notification settings - Fork 0
/
editprofile.php
77 lines (65 loc) · 2.3 KB
/
editprofile.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
67
68
69
70
71
72
73
74
75
76
77
<?php
session_start();
if (! isset($_SESSION['logged_in'])) {
header('Location: sign');
}
else {
$sessid = $_SESSION['id'];
}
require 'includes/header.php';
require 'includes/navconnected.php'; // require $nav; ?>
<div class="container-fluid product-page">
<div class="container current-page">
<nav>
<div class="nav-wrapper">
<div class="col s12">
<a href="index" class="breadcrumb">Smartshop</a> <a
href="editprofile" class="breadcrumb">Edit Profile</a>
</div>
</div>
</nav>
</div>
</div>
<div class="container editprofile">
<div class="container">
<div class="card">
<div class="row">
<form class="col s12" method="POST">
<div class="row">
<div class="input-field col s12">
<i class="material-icons prefix">email</i> <input
id="icon_prefix" type="text" name="email" class="validate"
required> <label for="icon_prefix">Email</label>
</div>
<div class="input-field col s12">
<i class="material-icons prefix">lock</i> <input id="icon_prefix"
type="password" name="password" class="validate value1" required>
<label for="icon_prefix">New Password</label>
</div>
<div class="input-field col s12 meh">
<i class="material-icons prefix">lock</i> <input id="icon_prefix"
type="password" name="confirmation" class="validate value2"
required> <label for="icon_prefix">Confirm Password</label>
</div>
<?php
if (isset($_POST['update'])) {
$newemail = $_POST['email'];
$newpassword = md5($_POST['password']);
include '../db.php';
// update info on users Toble
$queryupdate = "UPDATE users SET email ='$newemail', password ='$newpassword' WHERE id='$sessid'";
$result = $connection->query($queryupdate);
echo "<meta http-equiv='refresh' content='0'; url='editprofile' />";
}
?>
<div class="center-align">
<button type="submit" id="confirmed" name="update"
class="btn meh button-rounded waves-effect waves-light ">Submit</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<?php require 'includes/footer.php'; ?>