Chung Leong wrote:
"Michael Austin" <ma*****@firstdbasource.com> wrote in message
news:VT******************@newssvr24.news.prodigy.c om...
Chung Leong wrote:
"Alex" <al*******@hotmail.com> wrote in message
news:35********************@news20.bellglobal.c om...
$_SERVER["SERVER_NAME"] and $_SERVER["HTTP_HOST"] are good and all, but
none
of them are reliable.
Eg: Not all subdomains will have a vhost entry for them in Apache, or
the
Host: header is not filled in.
So are there any other methods of determining the URL of the script
itself?
Alex
The answer is no, as the URL itself is not passed in the request.
Chung: the answer is yes... hint: use phpinfo() to find it... then
search the docs to see how to code it...
Both the source and the target are specified.
Michael Austin.
Read the OP carefully, pal. He was referring to a HTTP 1.0 scenario, where
the host name is not included in the request. In that case when two DNS
names are mapped to the same IP address, there's no way for the server to
tell which of the two was actually typed in.
Name-based virtual hosting requires HTTP 1.1--that's a well known fact.
My apologies Chung, but, I did not see anywhere in the OP where he
mentions he was using HTTP 1.0. It is possible that he is, it is just
not stated. HTTP_REFERER is in both RFC's for HTTP. I don't have a
HTTP/1.0 server to test to see what server name is in the URL using
vhosts... I have used this reliably for a long time now...
So, Alex, did any of this solve your problem?
if not, then you can always define a <input type=hidden...> to define
the full path, however, you will need to be aware that anyone looking at
the source will be able to see it...
Michael Austin.