Re: [PHP] Working out the image path...partly solved, please have a look at my code

2004-10-13 Thread Mag
Hey Matt, /../imgs/blah.jpg should return http://www.textx.com/t1/t2/imgs/blah.jpg but its returning: http://www.textx.com/t1/t2/t3/imgs/blah.jpg and this: /../../imgs/blah.jpg should return: http://www.textx.com/t1/imgs/blah.jpg but its returning:

Re: [PHP] Working out the image path...partly solved, please have a look at my code

2004-10-12 Thread Matt M.
/../imgs/blah.jpg should return http://www.textx.com/t1/t2/imgs/blah.jpg but its returning: http://www.textx.com/t1/t2/t3/imgs/blah.jpg and this: /../../imgs/blah.jpg should return: http://www.textx.com/t1/imgs/blah.jpg but its returning: http://www.textx.com/t1/t2/imgs/blah.jpg

[PHP] Working out the image path...

2004-10-11 Thread Mag
Hey! Am having a little problem working out the logic in this, basically I pass a graphics path to a function and it should give/retrun me the URL path. ?php $url='http://x.com/t1/t2/t3/blah.html'; function ret_url($rel_path) { } ? so I pass a relitive url like this $a=ret_url('/blah.jpg';)

Re: [PHP] Working out the image path...

2004-10-11 Thread Curt Zirzow
* Thus wrote Mag: Hey! Am having a little problem working out the logic in this, basically I pass a graphics path to a function and it should give/retrun me the URL path. ?php $url='http://x.com/t1/t2/t3/blah.html'; function ret_url($rel_path) { } ? so I pass a relitive url like

[PHP] Working out the image path...partly solved, please have a look at my code

2004-10-11 Thread Mag
Hi, I wrote this to the list a little while back and have been working on it...i have come 95% of the way but for some reason cant work the other 5% out...can somebody help please? Basically I need to figure out the URL or a image from a relitive path...something like this: /blah.jpg // should

Re: [PHP] Working out the image path...partly solved, please have a look at my code

2004-10-11 Thread Matt M.
?php $url='http://www.textx.com/t1/t2/t3/blah.html'; function ret_url($rel_path, $base = '') { $base_path = substr($base, 0, strpos($base, '/',7)); if(substr($rel_path,0,1)=='/' !strpos($rel_path,'/../')) { return $base_path.$rel_path; } elseif(strpos($rel_path,'://')

Re: [PHP] Working out the image path...partly solved, please have a look at my code

2004-10-11 Thread Mag
Hey Matt, Thanks for replying. ?php $url='http://www.textx.com/t1/t2/t3/blah.html'; function ret_url($rel_path, $base = '') { $base_path = substr($base, 0, strpos($base, '/',7)); if(substr($rel_path,0,1)=='/' !strpos($rel_path,'/../')) { return $base_path.$rel_path;