Re: PHP application URL
| From: | Raul IONESCU <LYNX Fil Impex> | Date: | Fri, 27 Jun 2003 07:49:13 +0000 |
| Subject: | Re: PHP application URL | ||
| References: | 1 2 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-20593@lists.php.net to get a copy of this message | ||
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: raul@lynx.ro, raul@artbusinessromania.com
Tel/Fax: +4021 3103002, +4021 3159230, +4021 3145190, +4021 3143875
"Cristian Marin" <cristic@iakt.rdsnet.ro> wrote in message news:20030627071318.77695.qmail@pb1.pair.com...
> 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
> cristic@interakt.ro
> "Thai Thanh Ha" <thaiha@psv.com.vn> wrote in message
> news:0531BED80997D6119B9B00D0B748B66A13ECAA@MAIL...
> >
> > 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
>
>