Re: [PHP] Pass a relative path [with slashes] into a 'clean' url

2006-12-05 Thread Graham Anderson
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("|/[^/]/\\.

Re: [PHP] Pass a relative path [with slashes] into a 'clean' url

2006-12-05 Thread Richard Lynch
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

Re: [PHP] Pass a relative path [with slashes] into a 'clean' url

2006-12-05 Thread Aaron Koning
Assuming you mean URLs as GET variable values, urlencode() and urldecode() might be the ticket: http://ca.php.net/urlencode Aaron On 12/4/06, Graham Anderson <[EMAIL PROTECTED]> wrote: What is a good/accepted way to pass a relative or absolute path into a clean url ? I could replace the

[PHP] Pass a relative path [with slashes] into a 'clean' url

2006-12-04 Thread Graham Anderson
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/42/0/ e