Re: Pass a relative path [with slashes] into a 'clean' url
| From: | Graham Anderson | Date: | Tue, 05 Dec 2006 19:02:35 +0000 |
| Subject: | Re: Pass a relative path [with slashes] into a 'clean' url | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-245537@lists.php.net to get a copy of this message | ||
thanks :)
I'll give that a try
g
On Dec 5, 2006, at 10:48 AM, Richard Lynch wrote:
If you are composing these on the fly, you could use http://php.net/dirname for each element in front of a "../" and wipe out the subdir and the "../" Or, perhaps something like: $url = preg_replace("|/[^/]/\\.\\./|", "/", $url); On Mon, December 4, 2006 9:11 pm, Graham Anderson wrote:What is a good/accepted way to pass a relative or absolute path into a clean url ? I could replace the relative url's slashes with another character, but would love to know a cleaner less confusing way...if it exists example url: http://localhost/testscript/../image.png/jpeg/420000/0/ example php: list($dummy,$relative_path,$type, $color, $cache) = explode('/', $_SERVER['PATH_INFO']); where: $relative_path=../image.png $type=jpeg $color=420000 $cache=0 many thanks in advance -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php-- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php