Been a while since I've posted and I really hope someone can answer this one for me.
I have integrated Ash Young's directory script into an existing test site: the script can be found here:
http://evoluted.net/archives/2005/08/di ... isti_2.php
The script is called index.php by default, but I've renamed it to content14.php so as to be able to use the following php:
Code: Select all
<? $filename = 'content' . intval($_GET['c']) . '.php';
if( !file_exists($filename) ) { // use default filename if file is absent
$filename = 'content.php';
}
include($filename); ?>Within the script, I have $showdirs = true and the directories do, in fact, show up in the listing. When clicking on any 'file', I'm asked to either save it, or the appropriate plugin opens to read the file. However, clicking on a 'directory' loads the 'default file' (as in the code above) and I never see the content of the directory.
If I leave the script as is and call it in the browser as http://.../index.php, all functions work properly. After numerous hours of "tinkering", I've narrowed it down the $_SERVER[PHP_SELF] calls at lines 354 and 362 of the script - changing them to 'index.php?c=14' stops the default file from loading, but still doesn't show the directory content.
I would be incredibly grateful if someone would put me out of my misery and give some idea what the problem might be.
Many thanks and Happy '06 to everyone.