Re: inspirational
| From: | Michael Virnstein | Date: | Sun, 26 May 2002 10:20:29 +0000 |
| Subject: | Re: inspirational | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-99292@lists.php.net to get a copy of this message | ||
but the scriptname itself will be included there.
Try this, if you don't want the scriptname to be included.:
$url = preg_replace('/^(http:\/\/)[^\/]+((\/[^\/])*\/)([^\/]+)$/',
'\\1$SERVER_NAME\\2', $SCRIPT_URI);
Haven't tested them, but should work.
Michael
"Michael Virnstein" <michael.virnstein@web.de> schrieb im Newsbeitrag
news:20020526100917.54125.qmail@pb1.pair.com...
> typo:
>
> $url = preg_replace('/^(http:\/\/)[^\/]+(\/.*)$/', '\\1$SERVER_NAME\\2',
> $SCRIPT_URI);
>
> Michael
>
> "Michael Virnstein" <michael.virnstein@web.de> schrieb im Newsbeitrag
> news:20020526100647.51968.qmail@pb1.pair.com...
> > try:
> >
> > $url = preg_replace('/^(http:\/\/)[^\/]+(\/.*)$, '\\1$SERVER_NAME\\2',
> > $SCRIPT_URI);
> >
> > Michael
> >
> > "Jtjohnston" <taylorjo@collegesherbrooke.qc.ca> schrieb im Newsbeitrag
> > news:3CF0750E.C565AF1@collegesherbrooke.qc.ca...
> > > I want to detect the url my .php lies in.
> > >
> > > This is over kill and BS:
> > >
> > > $myurlvar =
> > > "http://".$SERVER_NAME.parse($SCRIPT_NAME);
> > >
> > > How do I get "http://foo.com/dir1/dir2/dir3/".D"މ~φº
> > > ºôÝŒ
> > >
> > > There seems to be nothing in phpinfo() that will give me a full url to
> > > play with.
> > >
> > > Flame me if you will, but I browsed TFM and found nothing
inspirational.
> > >
> > > Looked at phpinfo() too and got discouraged.
> > >
> > > I need a full url.
> > >
> > > John
> > >
> > >
> >
> >
>
>