<table width="100%" cellpadding="0" cellspacing="0" border="1" bordercolor="#000000">
<p class="testo_grigio_bold">
<?php
$i=1;
//definisco il path come relativo
$path = "../agenti_file";
//uso la funzione opendir
$dir_handle = @opendir($path) or die("Non riesco ad aprire $path");
//eseguo il while
$array_file = array();
while ($file = readdir($dir_handle)) {
if($file!='.' && $file!='..' && $file!='.htpasswd'){
$array_file[] = $file;
}
}
//chiudo la directory
closedir($dir_handle);
sort($array_file);
if ($i==1){
foreach($array_file as $file){
echo "<tr align=\"center\" valign=\"top\"><td><p class=\"testo_grigio_bold\"><a href=../agenti_file/$file>$file</a></p></td></tr>";}
}
if ($i==2){
foreach($array_file as $file){
echo "<tr align=\"center\" valign=\"top\"><td><p class=\"testo_grigio_bold\">
<a href=../agenti_file/$file>$file</p></td></tr>";}
}
$i=0;
$i++;
?>
</p>
</table>