in fact better solution would be $url = 'http://'.$_SERVER['HTTP_HOST'];
$url .= isset($_SERVER['REQUEST_URI'])?$_SERVER['REQUEST_URI']:(empty($_SERVER['QUERY_STRING'])?$_SERVER['PATH_INFO']:($_SERVER['PATH_INFO'].'?'.$_SERVER['QUERY_STRING'])); don't think so? ----------------------------------------------------------------- Raul IONESCU - IT Technician & WebMaster LYNX Fil Impex (www.lynx.ro) Art Business Romania (www.artbusinessromania.com) e-mail: [EMAIL PROTECTED], [EMAIL PROTECTED] Tel/Fax: +4021 3103002, +4021 3159230, +4021 3145190, +4021 3143875 "Cristian Marin" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > To know the full URL of a called page you can use this: > > $url='http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'] ; > > After this with preg_replace you can do what ever you want to with the URL. > > -- > ------------------------------------------------- > Cristian MARIN - Developer > InterAKT Online (www.interakt.ro) > Tel: +4021 312.53.12 > Tel/Fax: +4021 312.51.91 > [EMAIL PROTECTED] > "Thai Thanh Ha" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > > > Hi all, > > > > I want to get the URL of my application (and don't want to define it in a > > config file - I don't like telling my customers to config the app, even > run > > some install.php file). Anyone has code for this? I know that in generally > I > > cannot use a PHP function for this because we don't have true "PHP web > > applications" (like Java-based web applications) ( and most of the PHP > > applications define constants, like APP_BASE_URL,...). But I guess if I > put > > a special file (like "APP_ROOT") in my base application directory, I can > > find out the application URL from the URL of the requested file and file > > path of the requested file (The code for determining URL can be put in > > another PHP file and be included). Anyone have code like this? Please help > > me. Thanks in advance. > > > > Thai > >