URL Parsing
Posted: Thu Mar 08, 2012 4:03 pm
Is there a way of using PHP to capture the current URL (including parameters) and so using this to send as a session variable?
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
function getURL()
{
$string = (isset($_SERVER['HTTPS'])) ? 'https://' : 'http://';
$string .= $_SERVER['SERVER_NAME'];
$string .= $_SERVER['SCRIPT_NAME'];
$string .= ($_SERVER['QUERY_STRING']) ? '?' . $_SERVER['QUERY_STRING'] : '';
return $string;
}