//Code to Scan the Folder and Creating the link for the contents indside the folder.
//// Part One First Scan Only Top Level Folder
$sdir="";
$lst = "";
$fpath = "";
$xtra = 0;
$newdata ="";
$index = 0;
if(isset($_GET['fol']))$sdir = $_GET['fol'];
else $sdir = ".";
if ($dh = opendir($sdir))
{
$configfile = $sdir."/listconfig.php";
if(file($configfile))
{
include($configfile);
if(isset($linkindex))$index = 1;
}
while (($fle = readdir($dh)) != false)
{
$fpath = $sdir."/".$fle;
if($fle != "listconfig.php")
{
if($fle != "." && $fle != "..")
{
if(is_dir($fpath))
{
/*if($sdir == "." && $fle == "images")
{ }
else
{
if(substr($fle,0,1) == '_')
{ }
else
{
if($index == 1)
{
$lst = $lst."
";
}
else*/
$lst = $lst."";
/* }
}*/
}
else
{
if($sdir != ".")
{
//$tmp = pathinfo($fle);
//$ext = $tmp['extension'];
//if($ext == 'htm' || $ext == 'html' || $ext == 'php' || $ext =='asp' || $ext == 'jsp')
$lst = $lst."";
}
}
}
}
else
{
if(isset($wtxt))
{
$newdata = $wtxt;
$xtra = 1;
}
}
}
closedir($dh);
}
?>
Student Webpages
if($xtra == 1) echo("| ");
if($lst=="") echo("Empty Folder"); else echo($lst);
if($xtra == 1) echo(" | ".$newdata." "); ?>
|
|