Add files via upload

This commit is contained in:
Fernando Méndez
2021-06-04 14:30:48 +02:00
committed by GitHub
parent 786d28f70c
commit f9a0a3c5ba
3 changed files with 8 additions and 1 deletions

View File

@ -80,6 +80,12 @@ class FormChangeName extends Form {
} else {
$bd->changeUserName(unserialize($_SESSION['user'])->getId(), $nombre);
$user = $bd->selectUser($nombre, $password);
$actual_img = "../img/users/".unserialize($_SESSION['user'])->getName().".jpg";
$new_img = "../img/users/".$nombre.".jpg";
copy($actual_img, $new_img);
unlink($actual_img);
$_SESSION['user'] = serialize($user);
$_SESSION["nombre"] = $user->getName();
$_SESSION['message'] = "<div class='row'>