<?php
// generate_password.php
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    $password = $_POST['password'];
    $hashed = password_hash($password, PASSWORD_DEFAULT);
    echo "<h3>Hashed Password:</h3>";
    echo "<textarea style='width:100%; height:100px;'>" . htmlspecialchars($hashed) . "</textarea>";
    echo "<br><br><a href='generate_password.php'>Generate Another</a>";
    exit;
}
?>
<!DOCTYPE html>
<html>
<head>
    <title>Password Hash Generator</title>
</head>
<body>
    <h2>Generate Hashed Password</h2>
    <form method="POST">
        <label>Enter Password:</label><br>
        <input type="text" name="password" required style="width:300px; padding:8px;">
        <br><br>
        <button type="submit">Generate Hash</button>
    </form>
</body>
</html>