Instalação/Configuração> <dio_write
Last updated: Fri, 24 Feb 2012

Diretórios



User Contributed Notes
Diretórios
amal250 at gmail dot com
28-Mar-2012 03:41
<form id="browserform" action="browser.php" method="post">
<?php
$rootpath
='';
if(isset(
$_POST['rootpath']))
   
$rootpath=$_POST['rootpath'];       
?>
<input type="text" id="rootpath" name="rootpath" value="<?php echo $rootpath;?>" />
<?php

$handle
=opendir($rootpath);
if(
$handle!=null)
while (
false !== ($entry = readdir($handle))) {
    if(
is_dir($rootpath."/".$entry))
        echo
"<a href='#' onclick='opendir(\"$entry\")'>$entry</a><br>";
    else
        echo
"<a href='#' onclick='openfile(\"$entry\")'>$entry</a><br>";
}
?>
</form>
<script type="text/javascript">
function opendir(dir)
{
    if(dir=="..")
    {
        var path=document.getElementById("rootpath").value;
        var arr=path.split("/");
        path=arr[0];
        for(var i=1;i<arr.length-1;i++)
            path+="/"+arr[i];
        document.getElementById("rootpath").value=path;
        browserform.submit();
    }   
    else
    {
        document.getElementById("rootpath").value+="/"+dir;
        browserform.submit();
    }   
}
function openfile(dir)
{
    var path=document.getElementById("rootpath").value;
    window.open("player.php?path="+path+"/"+dir);
}
</script>

Instalação/Configuração> <dio_write
Last updated: Fri, 24 Feb 2012