From adf8db8f02ffce4e0fc621ef900c3993832b0fb2 Mon Sep 17 00:00:00 2001 From: lopar Date: Thu, 28 Mar 2019 17:02:04 +0200 Subject: [PATCH] errors fix --- enter.php | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/enter.php b/enter.php index 6738647..7e214c4 100644 --- a/enter.php +++ b/enter.php @@ -2,7 +2,7 @@ session_start(); include("config.php"); -foreach ($_POST as $key => $val) { //??????????????? +foreach ($_POST as $key => $val) { //Проверка всех значений массива POST одним махом. $_POST[$key] = iconv(mb_detect_encoding($_POST[$key], 'auto'), 'utf-8', $val); } @@ -55,24 +55,6 @@ if ($username && $password) { } } } - -/** - * Обновляем пароли пользователей... - */ - -$username_upd = filter_input(INPUT_POST, 'username_upd', FILTER_SANITIZE_SPECIAL_CHARS); -$password_upd = filter_input(INPUT_POST, 'password_upd'); - -if ($username_upd && $password_upd) { - $data = db::c()->query('SELECT `id`, `login` ,`pass`, `room`, `block` FROM `users` WHERE `login` = "?s" AND `pass` = "?s"', $username_upd, md5($password_upd))->fetch_assoc(); - if ($data['id']) { - db::c()->query('UPDATE `users` SET `pass` = "?s" WHERE `login` = "?s"', password_hash($password_upd, PASSWORD_DEFAULT), $username_upd); - header("Location: index.php"); - } else { - $error = 'Ошибка!'; - } -} - ?>