Код: Выделить всё
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$username = $_POST['username'];
$password = $_POST['password'];
$stmt = $conn->prepare("SELECT * FROM admin WHERE username=? AND password=?");
$stmt->bind_param("ss", $username, $password);
$stmt->execute();
$result = $stmt->get_result();
if ($result->num_rows > 0) {
$_SESSION['username'] = $username;
header("Location: dashboard.php");
exit();
} else {
$error_message = "Invalid username or password";
}
$stmt->close();
}
Код: Выделить всё
Document
[url=another_page.php]Link to another page[/url]
Код: Выделить всё
Пожалуйста, дайте мне знать, где я ошибаюсь.
Подробнее здесь: https://stackoverflow.com/questions/785 ... ected-page
Мобильная версия