www.webdeveloper.com
Results 1 to 2 of 2

Thread: Wrong domain for $_SERVER['SERVER_NAME'];

  1. #1
    Join Date
    Feb 2005
    Location
    Florida
    Posts
    219

    Wrong domain for $_SERVER['SERVER_NAME'];

    I have three virtual hosts in my server. No problems except one:

    Any script that uses $_SERVER['SERVER_NAME']; gives me timeshare-at-large.com as the domain. This is the last domain in my httpd.conf file, not the first one. I have another two domains, but I always get timeshare-at-large.com no matter where I use $_SERVER['SERVER_NAME'];.

    What's going on? Is this a bug involving multiple virtual hosts? There's nothing wrong with my httpd.conf file.

  2. #2
    Join Date
    Feb 2005
    Location
    Florida
    Posts
    219
    Actually, after working with this functions, I think I found the one that is causing the problem:

    gethostbyaddr("$_SERVER['SERVER_ADDR']);

    It seems that whenever I use that, I get timeshare-at-large as the domain. Maybe that's the first virtual host I created, I have no idea.

    It seems to be a configuration problem, or a bug. But all I need to do is avoid using that, which shouldn't be hard.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles