You are here: Re: Getting value of servername in <VirtualHost> « PHP Programming Language « IT news, forums, messages
Re: Getting value of servername in <VirtualHost>

Posted by davidkruger on 07/27/07 21:15

On Jul 27, 4:07 pm, "laredotorn...@zipmail.com"
<laredotorn...@zipmail.com> wrote:
> Hi,
>
> I'm using PHP 4.4.4 with Apache 2. How would I get the value of the
> "ServerName" attribute of the "<VirtualHost> directive in the Apache
> configuration (httpd.conf) file?
>
> I noticed that "$_SERVER['SERVER_NAME']" is not the answer to this
> question because we have multiple domains pointing to the same IP, and
> "echo $_SERVER['SERVER_NAME']" always yields a value typed in the
> browser's address bar.
>
> Thanks, - Dave

Hi, the $_SERVER['SERVER_NAME'] should do it...it should return
whatever is in your ServerName field, I thought... You could always
try making a test script with print_r($_SERVER); which will just print
all of the values in the $_SERVER array, then just look through to see
if one of the keys contains the info being sought. Sorry I am not
very much help here.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация