Hi,
I have a question, I am using document.location http://www.flights24.com/flight/wait/?s ... Airline%5D, it redirects me to this url http://www.flights24.com/flight/encodes ... c0abdeb7d/, I need to get this last url to send like parameter to another page. This is my php code.
----------------------------------------------------------------------------------------
echo "<script>document.location='http://www.flights24.com/flight/wait?sF ... ='</script>";
$protocol = strpos(strtolower($_SERVER['SERVER_PROTOCOL']),'https')
=== FALSE ? 'http' : 'https';
$host = $_SERVER['HTTP_HOST'];
$script = $_SERVER['SCRIPT_NAME'];
$params = $_SERVER['QUERY_STRING'];
$currentUrl = $protocol . '://' . $host . $script . '?' . $params;
echo $currentUrl;
header( 'Location: http://localhost/simplehtmldom_1_5/exam ... l.php?url='. $rez ) ;
-----------------------------------------------------------------------------------------
Thank you very much.
Get Current url of a loaded page with PHP
Moderator: General Moderators
Re: Get Current url of a loaded page with PHP
Are you saying you need to get the effective URL of another page on the internet? You could use curl and then use curl_getinfo to get CURLINFO_EFFECTIVE_URL.