I’d first like to mention that I’m not looking for an alternative method. I actually want to try and figure out how to fix this. I am sure a lot of you are familiar with this code:
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on")
{
$pageURL .= "s";
}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80")
{
$pageURL.=_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
}
else {
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
This code gets the URL of the current page it’s used on. What I want to do is get a string from the URL and put it into a session. I’ve tried using code such:
$_SESSION['pageURL']=$pageURL;
//and
$_SESSION['pageURL']= (string)$pageURL;
So far all of my effort have been fruitless, any help would be much appreciated…
$pageURLalready is a string, so:should work without any problems.
Are you using
session_start()somewhere?