Re: finding location of document

From: Date: Sun, 09 Nov 2003 02:13:37 +0000
Subject: Re: finding location of document
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-168971@lists.php.net to get a copy of this message
--- rogue <rogue@mail.rightcode.net> wrote: > Suppose I am running a script from an URL like: > > http://127.0.0.1/~myname/foo/bar.php > > on this page I want to redirect to another page and send a full http > string like: > > $redirect = "http://" . > $_SERVER['HTTP_HOST'] . "/foo/hello.php"; > > In this case, $_SERVER['HTTP_HOST'] is 127.0.0.1 > How can I get the ~/myname/ The complete relative URL requested is avialable to you as: $_SERVER["REQUEST_URI"] Hope that helps. Chris ===== My Blog http://shiflett.org/ HTTP Developer's Handbook http://httphandbook.org/ RAMP Training Courses http://www.nyphp.org/ramp

« previous php.general (#168971) next »