[PHP] script location
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 information. Any ideas? Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] script location
[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
RE: [PHP] script location
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 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] script location
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/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! pgpVpgXKhM7hi.pgp Description: PGP signature
Re: [PHP] script location
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://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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] script location
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 :-D -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] script location
* 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 $_SERVER['REQUEST_URI'] in case SCRIPT_URL isn't available. Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] script location
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
Re: [PHP] script location
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 battle. :-) GI JOE!!! ---John Holmes http://www.ebaumsworld.com/gijoe.html -- Regards, Ben Ramsey http://benramsey.com --- http://www.phpcommunity.org/ Open Source, Open Community Visit for more information or to join the movement. --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] script location
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 that would provide me this information. Any ideas? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php