Get Current url of a loaded page with PHP
Posted: Mon Apr 09, 2012 12:10 am
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.
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.