Heey alemaal,

ik ben bezig met een script voor een web ftp voor op school:P
nou heb ik het volgende: (sorrie, beetje lang:P)



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>



<script type="text/javascript">
<!-- Begin van de preloader script 

document.write('<br><br><br><br><br><br><center><div id="loading" style="border: 2px black solid; width: 200px; height: 100px;"><br><img src="icons/letop.gif" alt="Loading" /> Even geduld...</div>');
window.onload=function(){
    document.getElementById("loading").style.display="none";
}

// End -->
</script> 


<?php 
$dir = dirname($_SERVER['PHP_SELF']);
$dir = str_replace("/", "", $dir);
$dir = "U bevind zich in de directory: '" . $dir . "'";
?>
<title><?php echo $dir; ?></title>
<script>
window.status = "<?php echo $dir; ?>";
</script>
<style>
th
{
background-color: #666666;
color: #FFF;
text-align: left;
}

a
{
text-decoration: none;
}

a:hover
{
color: gray;
}
</style>
</head>
<body link="black" alink="black" vlink="black">


<center>
<br><br><br>

<table cellpadding="4px" cellspacing="0px" style="border: black 2px solid;">
<tr>
<th width="20px">

</th>
<th width="180px">
Naam:
</th>
<th width="60px">
Type:
</th>
<th width="80px">
Grote:
</th>
<th width="170px">
Gewijzigd op:
</th>
<th width="50px" colspan="2">
Actie:
</th>
</tr>

<?php
$i = "1";
$dir = "bestanden/"; // de directory die hij uit moet lezen
$color = "0";
if ($handle = @opendir($dir)) 
{
    while (false !== ($file = @readdir($handle))) 
		{ 
    	
		$ext = pathinfo($file);
		$bestand = str_replace("." . $ext['extension'], "", $file);
		IF ($i == "1")
	    {
	  $color = "#E1E1E1";
		$i = "0";
	    }
    else
      {
	  $color = "#FFFFFF";
	  $i = "1";	 
	    }
			
			
					IF (!($file == "." || $file == ".."))
					{
					 	 	 IF ($ext['extension'] == "")  // Mappen
							 {
							 echo "
			<tr bgcolor='". $color ."'> 
			<td valign='midle'><img src='icons/". $ext['extension'] .".gif' height='17px'></td>
			<td><a href='bestanden/". $file ."'>". $bestand ."</a></td><td>
			<td>&nbsp;</td>
			<td>&nbsp;</td>
			<td>&nbsp;</td>
			<td>&nbsp;</td>
			</tr>
						    ";
							 }
							
					}

		}
         closedir($dir);
}		
		
if ($handle = @opendir($dir)) 
{		
		while (false !== ($file = @readdir($handle))) 
		{ 
   	
		$ext = pathinfo($file);
		$bestand = str_replace("." . $ext['extension'], "", $file);
		IF ($i == "1")
	    {
	  $color = "#E1E1E1";
		$i = "0";
	    }
    else
      {
	  $color = "#FFFFFF";
	  $i = "1";	 
	    }
			
			
					IF (!($file == "." || $file == ".."))
					{
					
					 	 	 IF (!($ext['extension'] == ""))  // Bestanden
							 {
           $filesize = filesize("bestanden/" . $file);
					 $filesize = $filesize / 1000;
					 $filesize = round($filesize, 2);
					 				   
           echo "
					   <tr bgcolor='". $color ."'> 
					 	 <td valign='midle'><img src='icons/". $ext['extension'] .".gif' height='17px'></td>
			       <td><a href='bestanden/". $file ."'>". $bestand ."</a></td>
						 <td>" . $ext['extension'] . "</td>
			       <td>" . $filesize . " kb</td>
						 <td>" . date("d-m-'y  H:i:s", filemtime("bestanden/" . $file)) . "</td>
		         <td><a href='delete.php?bestand=" . $file . "'><img src='icons/verwijder.gif' border='0' alt='verwijder' width'20px'></a></td>
						    ";

											IF (
											    $ext['extension'] == "php" || 
											    $ext['extension'] == "txt" ||
													$ext['extension'] == "htm" ||
													$ext['extension'] == "js"  ||
													$ext['extension'] == "css" ||
													$ext['extension'] == "asp"																										
											   )
											{			
														echo "
																 <td><a href='edit.php?bestand=" . $file . "'><img src='icons/wijzigen.gif' alt='wijzigen' width'20px' border='0'></a></td>
																 ";
			                }
											else
											{
												echo "<td>&nbsp;</td>";		
											}
			echo "</tr>";
					     }		
					}

		}
				closedir($dir);
		
}
?>
</table>




















<?php
$diskfreespace = disk_free_space("/");
$diskspace = disk_total_space("/");
?>
<br>
<br>
<br>
<?php
$vrij = $diskfreespace / $diskspace * 100;
$vrij = round($vrij);
$gebruikt = 100 - $vrij;
$gebruikt = $gebruikt * 4;
$vrij = $vrij * 4;         
?>


<table cellpadding="4px" cellspacing="0px" style="border: black 2px solid; width: 500px;">
<tr>
<th>Schijf ruimte:</th>
</tr>
<tr>
<td><br>

<font style="width: <?php echo $gebruikt . "px"; ?> ; background-color: red; height: 30px; margin-left: 40px; padding: 5px;"><b>Gebruikt</b>   </font>
<font style="width: <?php echo $vrij . "px";    ?> ; background-color: green; height: 30px; margin-left: 2px; padding: 5px;"><b>Vrij</b></font>
<br><br>
</td>
</tr>
</table>
</center>

</body>
</html>



Nou krijg ik 2 foutmeldingen en de kleuren kloppen niet...

Warning: closedir(): supplied argument is not a valid Directory resource in C:\Documents and Settings\Versteeg\Mijn documenten\kinderen\Johan\Wamp-php\Scripts en Snipets\Verkenner\index.php on line 118

Warning: closedir(): supplied argument is not a valid Directory resource in C:\Documents and Settings\Versteeg\Mijn documenten\kinderen\Johan\Wamp-php\Scripts en Snipets\Verkenner\index.php on line 118

de kleuren gaan fout:
http://www.praise-culemborg.nl/webftp.gif

kan iemand mij helpen?

Groetejs Johan

Reageren