//-------------------------------------
//-----------index.php---------------
//-------------------------------------
[code]
<?php include('top.php'); ?>
<font color="#000000">	<div style="background-color: #F2F2EE; border: 1px solid #DDDDDD; width:705px; " id="verkenner">
<a href="javascript:history.go(-1)"><img src="img/folder_back.gif" border="0"></a>
		<a href="javascript:history.go(+1)"><img src="img/folder_forward.gif" border="0"></a><a href="../index.php"><img src="img/index.png" border="0" alt="Ga naar de hoofdpagina..."></a></div>
		<div style="background-color: #F2F2EE; border-center: 1px solid #FFFFFF; border-top: 1px solid #DDDDDD; border-bottom: 1px solid #FFFFFF; width:50px; float:center; ">


<div style="background-color: #F2F2EE; border-right: 1px solid #DDDDDD; border-top: 1px solid #DDDDDD; border-bottom: 1px solid #FFFFFF; width:550px; float:center; ">&nbsp;&nbsp;<?=$totaal_bestanden?>
<?php

echo "<title>Upload een file</title>";


if (!is_dir("bestanden/")) {
    die ("dir bestaat niet");
}

if ($_FILES['userfile']) {
    $message = do_upload($upload_dir, $upload_url);
}
else {
    $message = "Upload file";
}



function do_upload($upload_dir, $upload_url) {

if($_POST["dir"]=="bestanden") {
    $upload_dir = "bestanden/";
    }

elseif($_POST["dir"]=="mysql") {
    $upload_dir = "bestanden/";
    }

    else {
    $upload_dir = "bestanden/";
    }

    $temp_name = $_FILES['userfile']['tmp_name'];
    $file_name = $_FILES['userfile']['name']; 
    $file_type = $_FILES['userfile']['type']; 
    $file_size = $_FILES['userfile']['size']; 
    $result    = $_FILES['userfile']['error'];
    $file_url  = $upload_url.$file_name;
    $file_path = $upload_dir.$file_name;

    //File Name Check
    if ( $file_name =="") { 
        $message = "Foute file name";
        return $message;
    }
    //File Size Check
    else if ( $file_size > 500000) {
        $message = "Groter dan 500k.";
        return $message;
    }
    //File Type Check
    else if ( $file_type == "text/plain" ) {
        $message = "Sorry, geen scripts uploaden" ;
        return $message;
    }

    $result  =  move_uploaded_file($temp_name, $file_path);
    $message = ($result)?"File url <a href=$file_url>$file_url</a>" :
              "Er klopt iets niet met het bestand.";

    return $message;
}
?>
<div align="center"><form name="upload" id="upload" ENCTYPE="multipart/form-data" method="post">Upload bestand: <input type="file" id="userfile" name="userfile"><hr>
<input type="submit" name="upload" value="Upload"></div>
</form> 
<hr>  
<?php include('verkenner.inc'); ?>
		</div>

		


</div>
<?php include('bottom.php'); ?>
[/code]
//----------------------------------
//-------verkenner.inc-----------
//----------------------------------
[code]
<?
$pagina = "index.php";
$map = "bestanden/";
$naam_root = "Bestanden";
$map_icoontjes = "img/";
?>
<html>
<head>
<title>Verkenner.php</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style>
BODY
	{
	font-family:Arial, Helvetica, sans-serif;
	font-size:12px;
	margin-top:20px;
	}

#Main
	{
	width:710px;
	margin:auto;
	padding:auto;
	height:auto;
	}
	
#Map_structuur
	{
	width:300px;
	height:400px;
	padding: 0px 0px 0px 3px;
	margin: 0px 0px 0px 0px;
	border: 1px solid #EEEEEE;
	overflow:scroll;
	float:left;
	background-color:#FFFFFF;
	}
			
	#Map_structuur a
		{
		color: #000000;
		text-decoration:none;
		}
				
			
	#Map_structuur a:hover
		{
		color: #000000;
		text-decoration:underline;
		}
				
#Map_self
	{
	width:400px;
	height:400px;
	padding: 0px 0px 0px 0px;
	margin: 0px 0px 0px 0px;
	border: 1px solid #EEEEEE;
	overflow:scroll;
	float:left;
	background-color:#FFFFFF;
	}
			
	#Map_self a
		{
		color: #000000;
		text-decoration:none;
		}
				
			
	#Map_self a:hover
		{
		color: #000000;
		text-decoration:none;
		}
</style>

<script language="javascript" type="text/javascript">
function link(url)
	{
	window.location.href= url;
	}
</script>

</head>

<body link="#000000" vlink="#000000" alink="#000000" hlink="#000000">
<center>
<div id="Main">

<?

function file_size($size, $stap)
			{
			$naam_eenheid = array('1' => 'B', '2' => 'kB', '3' => 'mB', '4' => 'gB');
			if($size >= 1024)
				{
				$size = $size / 1024;
				$stap = $stap + 1;
				file_size($size, $stap);
				}
			
			else
				{
				echo(round($size).$naam_eenheid[$stap]);
				}
			}
$parts = explode("/", $_GET["folder"]);
$aantal = count($parts);
$i = 0;
while($i < ($aantal-2))
	{
	$vorige .= $parts[$i]."/";
	$i++;
	}
?>

	<div style="background-color: #F2F2EE; border: 1px solid #DDDDDD; width:705px; " id="verkenner">
	
		
		<a href="<?=$pagina?>?folder=<?=$vorige?>#verkenner"><img src="<?=$map_icoontjes?>folder_omhoog.gif" border="0"></a>
		
	</div>
	
	<div style=" padding: 3px 0px 3px 0px; background-color: #F2F2EE; border-left: 1px solid #DDDDDD; border-bottom: 1px solid #DDDDDD; border-right: 1px solid #DDDDDD; width:705px; ">
	
		&nbsp;Adres: <input type="text" value="<?=$naam_root?>:\<?
		$locatie = str_replace("/","\\",$_GET["folder"]);
		echo($locatie); ?>" size="106">
	
	</div>
		
	<div id="Map_structuur">
		
		<div style="background-color:#CCCCCC; padding: 5px 0px 5px 0px; margin: 0px 0px 10px 0px; width:300px; ">
		
			Mappen
		
		</div>
		
		<table cellpadding="0" cellspacing="0" border="0" width="280">
		
			<tr>
		
				<td><a href="<?=$pagina?>?folder=#verkenner"><img src="<?=$map_icoontjes?>disk.gif" border="0" height="18" style="vertical-align: middle; float:left; ">&nbsp;<?=$naam_root?></a></td>
				
			</tr>
		<?
		function verkennen($pagina, $map, $folder, $laag, $parts, $last, $map_icoontjes)
			{
			$parts = explode("/", $_GET["folder"]);
			$aantal = count($parts);
			$dir = $map.$folder;
			
			if ($dh = opendir($dir)) 
				{ 
				while (($file = readdir($dh)) !== false) 
					{
					if($file != "." && $file != "..")
						{
						if(filetype($dir . $file) == "dir")
							{
							$wijdte = ($laag * 20) + 160;
							?>
							
				<tr>
				
					<td width="<?=$wijdte?>"><?
							$not_empty = "";
							
							if ($dh2 = opendir($dir.$file)) 
								{ 
								while (($file2 = readdir($dh2)) !== false) 
									{
									if($file2 != "." && $file2 != "..")
										{
										if(filetype($dir.$file."/".$file2) == "dir")
											{
											$not_empty = $file2;
											}
										} 
									}
								closedir($dh2);
								}
							if(!$not_empty)
								{
								$i = -1;
								while($i < $laag)
									{
									?><img src="<?=$map_icoontjes?>map_not_up<? 
									if($file == $last)
										{
										 if(($laag-1) == $i)
											{
											echo("_end");
											}
										} ?>.gif" style="vertical-align: middle; float:left; "><?
									$i++;
									}
								}
							if($not_empty)
								{
								$i = 0;
								while($i < $laag)
									{
									?><img src="<?=$map_icoontjes?>map_not_up.gif" style="vertical-align: middle; float:left; "><?
									$i++;
									}
								?><a href="<?=$pagina?>?folder=<?=$folder.$file?>/#verkenner"><img src="<?=$map_icoontjes?>map_up<? 
									if($file == $last)
										{
										
											echo("_end");
											
										} ?>.gif" style="vertical-align: middle; float:left; " border="0"></a><?
								}
							?><a href="<?=$pagina?>?folder=<?=$folder.$file?>/#verkenner"><img src="<?=$map_icoontjes?>folder2.gif" border="0" height="18" style="vertical-align: middle; float:left;"><? if($parts[($aantal-2)] == $file) { ?><div style="background-color:#AAAAAA; float:left; margin: 1px 0px 1px 0px; "><? } ?>&nbsp;<?=$file?><? if($parts[($aantal-2)] == $file) { ?></div><? } ?></a></td>
							
				</tr>
							
							<?
							if($parts[$laag] == $file)
								{
								$laag_temp = $laag + 1;
								verkennen($pagina, $map, $folder.$file."/", $laag_temp, $parts, $not_empty, $map_icoontjes);
								}
							
							}
						} 
					}
				closedir($dh);
				}
			} 
			
		$laag = 0;
		$parts = explode("/", "/".$_GET["folder"]);	
		if ($dh2 = opendir($map)) 
			{ 
			while (($file2 = readdir($dh2)) !== false) 
				{
				if($file2 != "." && $file2 != "..")
					{
					if(filetype($map.$file2) == "dir")
						{
						$not_empty = $file2;
						}
					} 
				}
				closedir($dh2);
			}
			
		verkennen($pagina, $map, '', $laag, $parts, $not_empty, $map_icoontjes);
		?>
		
		</table>
		
	</div>
	
	<div id="Map_self">
		
		<table cellpadding="0" cellspacing="0" border="0" width="490">
		
			<tr>
			
				<td style="background-color:#DDDDDD; border-bottom:1px solid #BBBBBB; border-right:1px solid #BBBBBB;" width="200">Naam</td>
				<td style="background-color:#DDDDDD; border-bottom:1px solid #BBBBBB; border-right:1px solid #BBBBBB;" width="140">Type</td>
				<td style="background-color:#DDDDDD; border-bottom:1px solid #BBBBBB; border-right:1px solid #BBBBBB;" width="50">Grootte</td>
				<td style="background-color:#DDDDDD; border-bottom:1px solid #BBBBBB; border-right:1px solid #BBBBBB;" width="100">Laatst gewijzigd</td>
			
			</tr>
		<?
		$dir = $map.$_GET["folder"];
		
		if ($dh = opendir($dir)) 
			{ 
			while (($file = readdir($dh)) !== false) 
				{
				if($file != "." && $file != "..")
					{
					if(filetype($dir . $file) == "dir")
						{
						?>
						
			<tr onMouseOver="style.backgroundColor = '#EFEFEF';" onMouseOut="style.backgroundColor = '#FFFFFF';">
			
				<td style="font-size:11px; "><a href="#verkenner" onDblClick="javascript:link('<?=$pagina?>?folder=<?=$_GET["folder"]?><?=$file?>/#verkenner');"><img src="<?=$map_icoontjes?>folder2.gif" border="0" height="18" width="18" style="vertical-align: middle;"> <?=$file?></a></td>
				<td style="font-size:11px; ">Bestandsmap</div></td>
				<td style="font-size:11px; ">&nbsp;</td>
				<td style="font-size:11px; "><? echo date("d-m-Y H:i", filectime($dir.$file)); ?></td>
			
			</tr>
						<?
						}
					} 
				}
			closedir($dh);
			}
			
		if ($dh = opendir($dir)) 
			{ 
			while (($file = readdir($dh)) !== false) 
				{
				if($file != '.'){ if($file != '..')
					{
					if(filetype($dir . $file) == "file")
						{
						$parts = explode(".", $file);
						$aantal_punten = count($parts) - 1;
						$extensie = $parts[$aantal_punten];
						
						
						if($extensie == "pdf") 
							{ 
							$icon_file = "pdf"; 
							$name_type = "PDF bestand";
							}
						
						$images = array('jpg', 'JPG', 'jpeg', 'JPEG');
						for ($i = 0; $i < count($images); $i++)
							{
							if ($extensie == $images[$i])
								{
								$name_type = "JPG-afbeelding";
								$icon_file = "img_jpg";
								}
							}
							
						$images = array('gif', 'GIF');
						for ($i = 0; $i < count($images); $i++)
							{
							if ($extensie == $images[$i])
								{
								$name_type = "GIF-afbeelding";
								$icon_file = "img_gif";
								}
							}
							
						$images = array('png', 'PNG');
						for ($i = 0; $i < count($images); $i++)
							{
							if ($extensie == $images[$i])
								{
								$name_type = "PNG-afbeelding";
								$icon_file = "img_png";
								}
							}
							
						$images = array('bmp', 'BMP');
						for ($i = 0; $i < count($images); $i++)
							{
							if ($extensie == $images[$i])
								{
								$name_type = "Bitmapafbeelding";
								$icon_file = "img_bmp";
								}
							}
						
						$docs = array('doc', 'docx', 'DOC', 'DOCX');
						for ($i = 0; $i < count($docs); $i++)
							{
							if ($extensie == $docs[$i])
								{
								$name_type = "Microsoft Word-document";
								$icon_file = "img_doc";
								}
							}
						
						$docs = array('XLT', 'xlt', 'xml', 'XML', 'xls', 'XLS', 'xlw', 'XLW');
						for ($i = 0; $i < count($docs); $i++)
							{
							if ($extensie == $docs[$i])
								{
								$name_type = "Microsoft Exel-document";
								$icon_file = "img_xlt";
								}
							}
						
						$docs = array('txt', 'TXT', 'DOC', 'DOCX');
						for ($i = 0; $i < count($docs); $i++)
							{
							if ($extensie == $docs[$i])
								{
								$name_type = "Tekstdocument";
								$icon_file = "img_txt";
								}
							}
						
						$docs = array('htm', 'html', 'HTM', 'HTML', 'xml', 'XML', 'css', 'CSS', 'php', 'PHP', 'php3', 'PHP3', 'php4', 'PHP4', 'php5', 'PHP5');
						for ($i = 0; $i < count($docs); $i++)
							{
							if ($extensie == $docs[$i])
								{
								$name_type = "Webdocument";
								$icon_file = "img_html";
								}
							}
							
						if((!$name_type) && (!$icon_file))
							{
							$name_type = $extensie."-bestand";
							$icon_file = "img_else";
							}
						?>
						
			<tr onMouseOver="style.backgroundColor = '#EFEFEF';" onMouseOut="style.backgroundColor = '#FFFFFF';">
			
				<td style="font-size:11px; "><a href="#verkenner" onDblClick="window.open('<?=$dir.$file?>', 'Voorbeeld','status,width=400,height=400,location=no,status=no,menubar=no,directories=no,toolbar=no,resizable=yes,scrollbars=yes'); return false"><img height="18" width="18" src="<?=$map_icoontjes?><?=$icon_file?>.gif" border="0" style="vertical-align: middle;"> <?=substr($file, 0, 32)?></a></td>
	
	   
				<td style="font-size:11px; "><?=$name_type?></div></td>
				<td style="font-size:11px; "><?
				$size = filesize($dir.$file);
				$totaal_size += $size;
				file_size($size,"1");
				$totaal_bestanden += 1;
				?></td>
				<td style="font-size:11px; "><? echo date("d-m-Y H:i", filectime($dir.$file)); ?></td>
			
			</tr>
							
						<?
						}
						$icon_file = "";
						$name_type = "";
					} }
				}
			}
		?>
		
		</table>
		
		</div>
		
		<div style="background-color: #F2F2EE; border-right: 1px solid #DDDDDD; border-top: 1px solid #DDDDDD; border-bottom: 1px solid #FFFFFF; width:550px; float:left; ">&nbsp;&nbsp;<?=$totaal_bestanden?> Objecten </div>
		<div style="background-color: #F2F2EE; border-left: 1px solid #FFFFFF; border-top: 1px solid #DDDDDD; border-bottom: 1px solid #FFFFFF; width:50px; float:left; "><?=file_size($totaal_size, "1")?></div>
		<div style="background-color: #F2F2EE; border-left: 1px solid #FFFFFF; border-top: 1px solid #DDDDDD; border-bottom: 1px solid #FFFFFF; width:104px; float:left; ">&nbsp;</div>
		
	</div>

</div>
</body>
</html>
[/code]
//-------------------------
//-------top.php---------
//-------------------------
[code]
<html>
<head>
<title>Upload een file</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="style.css" />
<script language="JavaScript" type="text/javascript">
<!--
function confirmLink(link, text) {
 if(typeof(window.opera) != 'undefined') {
  return true;
 }
 var is_confirmed = confirm(text);
 if (is_confirmed) {
  location.href = link;
 }
 return is_confirmed;
}

function addtext(veld,text) {
 text = ''+text+' ';
 if(document.form.elements[veld].createTextRange) {
  document.form.elements[veld].focus();
  document.selection.createRange().duplicate().text = text;
 }else{
  document.form.elements[veld].focus();
  document.form.elements[veld].value += text;
 }
}

//-->
</script>
</head>
</body>
</html>
[/code]
//-------------------------
//------bottom.php------
//-------------------------
//Deze pagina slaat nu nergens op, maar als je copyright wilt gebruiken...
[code]
</body>
</html>
[/code]
De plaatjes zijn te downloaden op http://www.vleckanie.nl/phphulp/verkenner/plaatjes.zip.
Maak ook de map bestanden aan.