<?php
// generate_hash.php - A simple script to generate password hashes

echo "<h1>Password Hash Generator</h1>";

if (isset($_POST['password']) && !empty($_POST['password'])) {
    $plain_password = $_POST['password'];
    $hashed_password = password_hash($plain_password, PASSWORD_DEFAULT);

    echo "<p>Plain Password: <strong>" . htmlspecialchars($plain_password) . "</strong></p>";
    echo "<p>Hashed Password: <strong>" . htmlspecialchars($hashed_password) . "</strong></p>";
    echo "<p>You can use this hash in your `users` table.</p>";
} else {
    echo "<p>Enter a password below to generate its hash.</p>";
}
?>

<form method="POST" action="">
    <label for="password">Enter Password:</label><br>
    <input type="text" id="password" name="password" size="50" required><br><br>
    <button type="submit">Generate Hash</button>
</form>