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:
/../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
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';)
* 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
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
?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,'://')
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;
7 matches
Mail list logo