How can you ensure that the URL variable is properly inserted in Header Location in PHP?
To ensure that the URL variable is properly inserted in Header Location in PHP, you should make sure that the URL is properly encoded to prevent any issues with special characters. You can achieve this by using the `urlencode()` function on the URL variable before concatenating it in the Header Location.
<?php
$url = 'http://example.com/page.php?id=123';
$encoded_url = urlencode($url);
header("Location: " . $encoded_url);
exit();
?>