|
-
Jun 25th, 2010, 09:54 AM
#1
Thread Starter
Hyperactive Member
[RESOLVED] PHP Domain Check
If I configure a sub domain on a hosting server, and the domain/sub domain point at the same directory to filter through a common front-controller, would it be accurate to perform a check on $_SERVER['SERVER_NAME'] in said front-controller, to determine from where a user has accessed the site?
-
Jun 25th, 2010, 12:01 PM
#2
Re: PHP Domain Check
HTTP_HOST and SERVER_NAME would both work fine as long as you've got a properly configured web server. sometimes, SERVER_NAME could return something unexpected if your server name definitions aren't set explicitly, however.
-
Jun 25th, 2010, 01:24 PM
#3
Thread Starter
Hyperactive Member
Re: PHP Domain Check
Thanks kows, SERVER_NAME does the trick, I was just curious of it's consistency in accuracy.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|