-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathadmin-user-edit-submit.php
More file actions
41 lines (31 loc) · 1.2 KB
/
Copy pathadmin-user-edit-submit.php
File metadata and controls
41 lines (31 loc) · 1.2 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
<?php
include('includes/connection.php');
//include('includes/session.php');
//error_reporting(E_ALL & ~E_NOTICE);
$id= $_POST['EditID'];
$newName = $_POST['EditName'];
$newEmail = $_POST['EditEmail'];
$newPassword = sha1($_POST['EditPassword']);
$newPassword2 = sha1($_POST['EditPassword2']);
$newType = $_POST['EditType'];
$newContact = $_POST['EditContact'];
if ($newPassword != $newPassword2){
$message = base64_encode(urlencode("Passwords do not match"));
header('Location:admin-user-edit.php?msg=' . $message);
exit();
}
else{
$EditQuery= "UPDATE users SET name = '$newName', email ='$newEmail', password = '$newPassword', usertype = '$newType' , contact = '$newContact' WHERE userID = '$id' ";
if (mysqli_query($connection,$EditQuery) === TRUE) {
$message = base64_encode(urlencode("Successfully Edited !"));
header('Location:admin-user-edit.php?msg=' . $message);
exit();
}
else {
$message = base64_encode(urlencode("SQL Error while Registering"));
header('Location:admin-user-edit.php?msg=' . $message);
exit();
}
}
mysqli_close($connection);
?>