What are the potential security risks of passing variables through URLs in PHP, especially sensitive information like passwords?

Passing sensitive information like passwords through URLs in PHP can pose a security risk because URLs are visible in browser history, server logs, and can be easily intercepted. To mitigate this risk, it is recommended to use POST method for passing sensitive information instead of GET method.

<form method="post" action="process.php">
    <input type="text" name="username" placeholder="Username">
    <input type="password" name="password" placeholder="Password">
    <button type="submit">Submit</button>
</form>