ah, ich bin so dämlich, das wo er keine farbe zuordnet sind die ausnahmen in der "if ($file.." schleife, mannomann, sorry und thx für die tipps
so funkts natürlich
Code:
<head>
<link rel="stylesheet" type="text/css" href="css.css">
<title>
Index of /
</title>
</head>
<body>
<?php
$zaehler=0;
// open the current directory by opendir
$handle=opendir(".");
while (($file = readdir($handle))!==false) {
if ($file !=='files' && $file !=='private' && $file !=='mail' && $file !=='sommer2008'){
$zaehler++;
#echo '<br><br>'.$zaehler.'<br><br>';
if ($zaehler==1){
$colour='rot';
} elseif ($zaehler==2){
$colour='green';
} else {
$colour='blue';
$zaehler=0;
}
echo '<p><a class="'.$colour.'" href="'.$file.'"> </a>';
echo '<a href="'.$file.'">'.$file.'</a>';
}
}
closedir($handle);
?>
</table>
</body>