What are the limitations of using $_SERVER['HTTP_REFERER'] to retrieve the URL in PHP?

The limitation of using $_SERVER['HTTP_REFERER'] to retrieve the URL in PHP is that it is not always reliable as it can be easily manipulated or blocked by the client. To solve this issue, a more secure and reliable method would be to pass the URL as a parameter through the GET method.

// Retrieving the URL using the GET method
$url = isset($_GET['url']) ? $_GET['url'] : '';

// Using the retrieved URL
echo "The URL is: " . $url;