-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathupdate.php
More file actions
27 lines (20 loc) · 746 Bytes
/
update.php
File metadata and controls
27 lines (20 loc) · 746 Bytes
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
<?php
include_once("./db.php");
echo $_SESSION["currentEmail"];
class Edit extends Connection{
public function update(){
$conexion = $this->connect();
if (isset($_POST["update"])) {
$name_user = $_POST['nombre'];
$email = $_POST['correo'];
$password = password_hash($_POST['password'], PASSWORD_DEFAULT);
$sql = "UPDATE users SET name='$name_user', email='$email', password='$password' WHERE email='$email'";
$result = mysqli_query($conexion, $sql);
if ($result) {
echo "<p>Cambiado correctamente</p>";
}
}
}
}
// ;
?>