What are the potential security risks of passwords being visible in the address bar in PHP?

Potential security risks of passwords being visible in the address bar in PHP include the possibility of the password being intercepted by unauthorized users, leading to unauthorized access to sensitive information or accounts. To prevent this, passwords should never be passed as parameters in the URL or displayed in the address bar.

// Example of passing password securely using POST method instead of GET method
<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>