PHP: HTTP_HOST vs. SERVER_NAME
Posted by: BGilkison
Posted on: 2003-02-04 14:24:00
Philosphically speaking, I'm looking for some guru-thoughts on the better of _SERVER["HTTP_HOST"] or _SERVER["SERVER_NAME"] to use when building things like a "page-stamp" in a footer, i.e., showing the user the URL of the page they're actually looking at, on the off-chance that my site gets "framed" in some way (for an example of what I'm talking about, see a page at my site, e.g. http://genes.gilkison.net/ky10cav/dyer.html).
I realize that they both display the same thing at this point (at least they do on my DH setup), but what is the difference supposed to be? I try to build my scripts, such as they are, defensively, and these things seem to change occasionally from one version of PHP to another, so I'd like ot try and use the appropriate one...