RyanB88
11-28-2006, 06:08 AM
I am devloping a page which will have several domains parked on it so the user can access the page from one of several domains. My issue is I want to find out with PHP what url they entered to get to my script, I assume just getting the referer won't work so is their a way to get the url they typed in? Because the page is going to vary slightly depending on the domain so i need to get the domain they entered to pull the correct info from my db.
take a look at the contents of the $_SERVER superglobal, I think (though I get the names confused sometimes) that $_SERVER['HTTP_HOST'] will contain what you're after
RyanB88
11-28-2006, 07:09 AM
take a look at the contents of the $_SERVER superglobal, I think (though I get the names confused sometimes) that $_SERVER['HTTP_HOST'] will contain what you're after
from http://us3.php.net/reserved.variables
'HTTP_HOST'
Contents of the Host: header from the current request, if there is one.
its kinda vauge but dosen't sound like it gives me what I want,
from the same site
'QUERY_STRING'
The query string, if any, via which the page was accessed.
this sounds like what I would use but I am not sure, I have to way to qucikly test this as of now, so if you can verify this i'd appriciate it.
print_r($_SERVER);
echo $_SERVER['HTTP_HOST'];
will tell you...