downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Installing/Configuring> <dio_write
[edit] Last updated: Fri, 11 May 2012

view this page in

Directories



add a note add a note User Contributed Notes Directories
amal250 at gmail dot com 28-Mar-2012 05:11
<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>

 
show source | credits | sitemap | contact | advertising | mirror sites