Re: Parsing Current Server Domain
| From: | Curt Zirzow | Date: | Thu, 28 Aug 2003 16:11:16 +0000 |
| Subject: | Re: Parsing Current Server Domain | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-161057@lists.php.net to get a copy of this message | ||
* Thus wrote jeffrey pearson (jpearson@usc.edu):
> Does anyone know how I would parse the domain that scripts are currently being executed in?
>
> ...
>
> dev.domain.com/somefile.php
>
> where on the live site it would be
>
> www.domain.com/somefile.php
In most cases $_SERVER['HTTP_HOST'] is what you want. It wont be
available if you access the site with the ip address.
Curt
--
"I used to think I was indecisive, but now I'm not so sure."