What are the potential security risks of sending passwords via URL in PHP scripts?

Sending passwords via URL in PHP scripts can pose security risks as URLs are often stored in browser history, server logs, and can be intercepted by third parties. To mitigate this risk, passwords should never be sent via URL. Instead, passwords should be sent securely using methods like POST requests over HTTPS.

// Bad practice: Sending password via URL
$password = $_GET['password'];

// Good practice: Sending password via POST request over HTTPS
$password = $_POST['password'];