include issue

Hi, guys. I’m trying to include a folder that is essentially an apache listing of files. However, in doing this, the files have the wrong links associated with them. For example, if my php script is called at

http://duke3d.org/test.php

and I include the contents of http://duke3d.org/miclus

I will see the apache file listing like normal, but all links are offset wrong like

http://duke3d.org/mypicture.jpg

instead of

http://duke3d.org/miclus/mypicture.jpg

Any way to fix this?

It’s as if the apache file listing uses as the base directory wherever my script it. I need it to behave as if I browsed to the directory in my browser directly.

Can we see your code for the linking?

There is no solution. You must modify include to change directory, using a var for example.

file1.php

$directory =‘miclus/’;
include ‘miclus/index.php’;

file : micluc_/index.php

if(isset($directory)) && (directory!=’’)){
chdir($directory);
}

Try

[code]./miclus/mypicture.jpg

[/code]

Sponsor our Newsletter | Privacy Policy | Terms of Service