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/bla

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. > > > > > $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 $ba

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

2004-10-11 Thread Matt M.
> > $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_pat

[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 r