foreach( $files as $file ) {
if( file_exists($root . $_POST['dir'] . $file) && $file != '.' && $file != '..' && !is_dir($root . $_POST['dir'] . $file) ) {
$ext = preg_replace('/^.*\./', '', $file);
echo "<li class=\"file ext_$ext\"><a href=\"#\" rel=\"" . htmlentities($_POST['dir'] . $file) . "\">" . htmlentities($file) . "</a></li>";
}
}
foreach( $files as $file ) {
if( file_exists($root . $_POST['dir'] . $file) && $file != '.' && $file != '..' && !is_dir($root . $_POST['dir'] . $file) ) {
$ext = preg_replace('/^.*\./', '', $file);
echo "<li class=\"file ext_$ext\"><a href=\"" . htmlentities($_POST['dir'] . $file) . "\" rel=\"" . htmlentities($_POST['dir'] . $file) . "\">" . htmlentities($file) . "</a></li>";
}
}
<script type="text/javascript">
function openFile(file) {
window.location = file;
}
$(document).ready( function() {
$('#fileTreeDemo_1').fileTree({ root: '../', script: 'jqueryFileTree.php' }, function(file) {
openFile(file);
});
});
</script>
If you have an apache server for your web server, then you can enable directory listing by creating or modifying your .htaccess file: http://www.clockwatchers.com/htaccess_dir.html
If you are using a Windows server for your webserver and have IIS and ASP.NET configured, you can enable directory listing by modifying your web.config and putting in this configuration:
Open in new window