Does anyone know of a simple/efficient way to determine the path to a
script on the URL?
For instance:
http://www.nowhere.com/test/whatever/testing.php
All I want out of that URL is this:
/test/whatever/
I didn't see an element in one of the super global variables that would
provide me this
[snip]
http://www.nowhere.com/test/whatever/testing.php
All I want out of that URL is this:
/test/whatever/
[/snip]
http://php.net/dirname
I think that will do it
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
See the parse_url() function.
-Original Message-
From: Matt Matijevich [mailto:[EMAIL PROTECTED]
Sent: Friday, June 04, 2004 9:57 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] script location
[snip]
http://www.nowhere.com/test/whatever/testing.php
All I want out
Gabe --
...and then Gabe said...
%
% Does anyone know of a simple/efficient way to determine the path to a
% script on the URL?
Gee, it sounds like you want the dirname() of the SCRIPT_URL. You're on
the right track :-)
HTH HAND
:-D
--
David T-G
[EMAIL PROTECTED]
Thanks Matt and James... very helpful!
James Harrell wrote:
See the parse_url() function.
-Original Message-
From: Matt Matijevich [mailto:[EMAIL PROTECTED]
Sent: Friday, June 04, 2004 9:57 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] script location
[snip]
http
Knowing the functions is half the battle. :-)
David T-G wrote:
Gabe --
...and then Gabe said...
%
% Does anyone know of a simple/efficient way to determine the path to a
% script on the URL?
Gee, it sounds like you want the dirname() of the SCRIPT_URL. You're on
the right track :-)
HTH HAND
* Thus wrote David T-G ([EMAIL PROTECTED]):
Gabe --
...and then Gabe said...
%
% Does anyone know of a simple/efficient way to determine the path to a
% script on the URL?
Gee, it sounds like you want the dirname() of the SCRIPT_URL. You're on
the right track :-)
Or dirname() of
From: Gabe [EMAIL PROTECTED]
Knowing the functions is half the battle. :-)
GI JOE!!!
---John Holmes
http://www.ebaumsworld.com/gijoe.html
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Well, then... let me win the whole battle for you:
$path = $_SERVER['REQUEST_URI'];
$path = dirname($path);
echo $path;
You can use REQUEST_URI, SCRIPT_NAME, or PHP_SELF.
Now you know, and knowing is . . . ;-)
John W. Holmes wrote:
From: Gabe [EMAIL PROTECTED]
Knowing the functions is half the
I use of realpath()
Does anyone know of a simple/efficient way to determine the path to a
script on the URL?
For instance:
http://www.nowhere.com/test/whatever/testing.php
All I want out of that URL is this:
/test/whatever/
I didn't see an element in one of the super global variables
10 matches
Mail list logo