-
Notifications
You must be signed in to change notification settings - Fork 0
/
edit_profile.php
40 lines (30 loc) · 1017 Bytes
/
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
<?php
session_start();
?>
<?php
if (!isset($_SESSION['id'])) {
header('location: index.php');
}
include('connection/connection.php');
?>
<?php
$fName=$_POST['fName'];
$lName=$_POST['lName'];
$department=$_POST['department'];
$role=$_POST['role'];
$email=$_POST['email'];
// $password=$_POST['password'];
$query = "UPDATE `users` SET `fName` = '$fName',`lName` = '$lName',`email` = '$email',`department` = '$department'
WHERE `id` = ".$_SESSION['id'];
$result = mysqli_query($conn, $query);
$result = mysqli_query($conn, $query);
if ($result) {
// Set a session variable to indicate success
$_SESSION['updated'] = true;
}
header('location: users-profile.php');
?>
<!-- <script type="text/javascript">
alert("Editing Completed Successfully!");
window.location = "users-profile.php";
</script> -->