Ошибка:
Warning: Cannot modify header information - headers already sent by (output started at C:\OSPanel\domains\test\config\db_params.php:1) in C:\OSPanel\domains\test\models\Admin.php on line 14
Код:
spoiler<?php
include_once 'components/Db.php';
class Admin {
public static function CheckAdmin()
{
$db = Db::getConnection();
$result = $db->query("SELECT * FROM admin");
foreach ($result as $row ) {
$login = $row['login'];
$password = $row['password'];
if (isset($_POST['submit'])) {
if ($login == $_POST['login'] && $password == $_POST['password']) {
header('Location: admin/list');
exit;
}
else {
echo "Не правильно";
};
}
}
// $login = $row['login'];
// $password = $row['password'];
// $login = 'admin';
// $password = 'admin';
}
} //Конец класса
?>