What is the potential issue with using $_GET to retrieve data from a form submitted with method="POST" in PHP?

Using $_GET to retrieve data from a form submitted with method="POST" in PHP can lead to potential security vulnerabilities as sensitive information may be exposed in the URL. To solve this issue, you should always retrieve form data using $_POST when the form is submitted with method="POST".

// Example of retrieving form data using $_POST
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    $username = $_POST["username"];
    $password = $_POST["password"];
    
    // Process the form data securely
}