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

Passing sensitive information like passwords through URLs in PHP can pose security risks as URLs are visible in browser history, server logs, and can potentially be intercepted. To mitigate this risk, sensitive information should be passed through POST requests instead of GET requests.

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