-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprofile.php
70 lines (46 loc) · 2.05 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
67
68
69
70
<?php
require_once("assest/header.php");
require_once("class/Account.php");
require_once("class/fillterform.php");
require_once("class/Constants.php");
$user= new User($con,$userLoggedin);
if(isset($_POST["SaveButtonDetails"])) {
$account = new Account($con);
$firstName = filterform::sanitizerFormstring($_POST["firstName"]);
$lastName = filterform::sanitizerFormstring($_POST["lastName"]);
$email = filterform::sanitizerFormEmail($_POST["email"]);
if($account->UpdateDetails($firstName,$lastName,$email,$userLoggedin)){
//Sucess
echo "update";
}
else {
///failure
echo "No update";
}
}
?>
<div class="SettingContainers column">
<div class="formSection">
<form method="POST">
<h2> User Details</h2>
<?php
$firstName = isset($_POST["firstName"]) ? $_POST["firstName"] : $user->getfirstName();
$lastName = isset($_POST["lastName"]) ? $_POST["lastName"] : $user->getlastName();
$email = isset($_POST["email"]) ? $_POST["email"] : $user->getUsername();
?>
<input type="text" name="firstName" placeholder="Enter First name" value="<?php echo $firstName; ?>">
<input type="text" name="lastName" placeholder="Enter Last Name" value="<?php echo $lastName; ?>">
<input type="email" name="email" placeholder="Pleas Enter Email" value="<?php echo $email; ?>">
<input type="submit" name="SaveButtonDetails" value="Save" >
</form>
</div>
<div class="formSection">
<form method="POST">
<h2> Update Password</h2>
<input type="password" name="oldpassword" placeholder="Enter Old PassWord">
<input type="password" name="newpassword" placeholder="Enter New Password">
<input type="password" name="confirmpassword" placeholder="Confirm New Password">
<input type="submit" name="SavepasswordDetails" value="Submit" >
</form>
</div>
</div>