<?php
// Define the correct username and password
$correctUsername = "admin";
$correctPassword = "password123";

// Check if the form was submitted
if (isset($_POST['username']) && isset($_POST['password'])) {
    $username = $_POST['username'];
    $password = $_POST['password'];

    // Verify the submitted credentials
    if ($username === $correctUsername && $password === $correctPassword) {
        // Authentication successful
        echo "Welcome, " . htmlspecialchars($username) . "!"; 
        // Here you can include your protected content or functionality
        echo "Test 123 ";
    } else {
        // Authentication failed
        $error = "Invalid username or password!";
    }
}
?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Login Required</title>
</head>
<body>
    <?php if (isset($error)): ?>
        <p style="color: red;"><?php echo $error; ?></p>
    <?php endif; ?>

    <form method="post" action="">
        <label for="username">Username:</label>
        <input type="text" id="username" name="username" required>
        <br><br>
        <label for="password">Password:</label>
        <input type="password" id="password" name="password" required>
        <br><br>
        <button type="submit">Login</button>
    </form>
</body>
</html>

