-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathuserEdit.php
28 lines (19 loc) · 852 Bytes
/
userEdit.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
<?php
include('session.php');
$query= "UPDATE users
SET user_nicename='" . $_POST["nome"] . "', user_mail='" . $_POST["userEmail"] . "', user_adress='" . $_POST["morada"] . "', user_phone='" . $_POST["phone"] . "', user_pw='" . sha1($_POST["password"]) ."'
WHERE id_user='" . $user_id . "'";
if (mysqli_query($connection, $query)) {
echo "<script type=\"text/javascript\">".
"alert('Atualização feita com sucesso');"
. "window.location = 'menu.php';".
"</script>";
}
else {
echo "<script type=\"text/javascript\">".
"alert('Erro');".
"</script>";
echo "Error: " . $query . "<br>" . mysqli_error($connection);
}
$connection->close();
?>