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
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 th
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
* 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(
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
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
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]
http://justpickone.org/d
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/wha
[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
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 info
10 matches
Mail list logo