Re: default domain name

From: Date: Fri, 16 Dec 2011 13:33:46 +0000
Subject: Re: default domain name
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-30754@lists.php.net to get a copy of this message
On Fri, Dec 16, 2011 at 2:28 PM, Vinay Kannan <vinykan@gmail.com> wrote: > Hello, > > I need your help on something, i am developing an application, and there > are couple of modules where i need to provide the entire link of the domain > along with the sub dirs. > So i was wondering what is the way, to provide the default domain name > which will work on any domain. > > for ex : if the file is lib/test.php, then a way to call it should be the > same if the domains are www.abc.com or www.xyz.com or any other domain. > something like the dirname, basename etc... > > but i haven't had much luck on the same, any ideas? > > Thanks, > if you are looking for getting the domain for the current request, you should use $_SERVER['HTTP_HOST'], you can also use relative and urls for linking content from the same domain ( http://www.w3.org/TR/html4/types.html#type-uri ) -- Ferenc Kovács @Tyr43l - http://tyrael.hu

« previous php.windows (#30754) next »