Re: Request domain name
| From: | Kim Steinhaug | Date: | Wed, 25 Feb 2004 22:44:21 +0000 |
| Subject: | Re: Request domain name | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-178893@lists.php.net to get a copy of this message | ||
Try this one :
$_SERVER["HTTP_HOST"]
It will do the trick for you, it will give you the root domain
in the URI of your browser.
--
--
Kim Steinhaug
----------------------------------------------------------------------
There are 10 types of people when it comes to binary numbers:
those who understand them, and those who don't.
----------------------------------------------------------------------
www.steinhaug.com - www.easywebshop.no - www.webkitpro.com
----------------------------------------------------------------------
"Age Bosma" <agebosma@home.nl> wrote in message
news:20040225141254.28888.qmail@pb1.pair.com...
> I would like to be able to request the domain name.
> How can this be achieved without hardcoding it?
>
> $_SERVER['REQUEST_URI'] doesn't provide me the domain name, it just
> provides me "/index.php?page=2000" instead of e.g.
> "www.blaat.com/index.php?page=2000"
> I can't seem to find anything on the php site to get the domain name as
> well.
>
> I prefer using absolute URI's.
> The reason why this is a problem for me is besause I'm working on a site
> which has two different URI's but both display the exact same site.
>
> Cheers,
>
> Age Bosma