How can I hide a password input in a login form using PHP?

To hide a password input in a login form using PHP, you can use the "password" type for the input field. This will display the input as dots or asterisks instead of showing the actual characters typed by the user. This helps to protect the user's password from being visible on the screen.

<form action="login.php" method="post">
    <label for="username">Username:</label>
    <input type="text" id="username" name="username"><br><br>
    
    <label for="password">Password:</label>
    <input type="password" id="password" name="password"><br><br>
    
    <input type="submit" value="Login">
</form>