What are the potential security risks of including login credentials in the URL?

Including login credentials in the URL can pose a security risk as URLs are often logged in various places such as browser history, server logs, and can be easily intercepted by malicious actors. To mitigate this risk, it is recommended to use secure methods such as POST requests to send login credentials.

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