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