Results 1 to 3 of 3

Thread: [RESOLVED] PHP Domain Check

  1. #1

    Thread Starter
    Hyperactive Member tomcatexodus's Avatar
    Join Date
    Feb 2001
    Posts
    372

    Resolved [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?
    IWS

  2. #2
    PowerPoster
    Join Date
    Sep 2003
    Location
    Edmonton, AB, Canada
    Posts
    2,629

    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.

  3. #3

    Thread Starter
    Hyperactive Member tomcatexodus's Avatar
    Join Date
    Feb 2001
    Posts
    372

    Re: PHP Domain Check

    Thanks kows, SERVER_NAME does the trick, I was just curious of it's consistency in accuracy.
    IWS

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width