|
Posted by Peter on 11/19/79 11:47
Hi there, I am using this code to retrieve the current URL:
function selfURL() {
$s = empty($_SERVER["HTTPS"]) ? ''
: ($_SERVER["HTTPS"] == "on") ? "s"
: "";
$protocol = strleft(strtolower($_SERVER["SERVER_PROTOCOL"]), "/").$s;
$port = ($_SERVER["SERVER_PORT"] == "80") ? ""
: (":".$_SERVER["SERVER_PORT"]);
return
$protocol."://".$_SERVER['SERVER_NAME'].$port.$_SERVER['REQUEST_URI'];
}
function strleft($s1, $s2) {
return substr($s1, 0, strpos($s1, $s2));
}
which returns the URL of the current PHP script.
But, I would like it to return the URL of the html page that preceeded
this script.
I mean, I have a some html pages with some photos. I have a form that
allows users to enter an email address that will then send the link of
that html page to the email address used.
When I use the above it only shows the address of the page that
executed the command, not the original html document.
Can this even be done?
Thanks,
Peter.
Navigation:
[Reply to this message]
|