
02/07/2009, 16:54
|
| | Fecha de Ingreso: marzo-2009
Mensajes: 7
Antigüedad: 15 años, 11 meses Puntos: 0 | |
Respuesta: Download en PHP Este es el codigo que estoy intentando usar, pero no me anda.
Si alguien encuantra algun error o tiene algun consejo se agradece.
<div id="texto1">
<h2>Bienvenido a Virtual Proyect 1.0 !</h2>
<?php
if ($dh = opendir('./')) {
$files = array();
while (($file = readdir($dh)) !== false) {
array_push($files, $file);
}
closedir($dh);
}
sort($files);
echo "<ul>\n";
foreach ($files as $file) {
$title = Title($file);
echo "<li><a href=\"$file\" title=\"$title\">$title</a></li>\n";
}
echo "</ul>\n";
function Title($filename) {
$title = substr($filename, 0, strlen($filename) - 4);
$title = str_replace('-', ' ', $title);
$title = ucwords($title);
return $title;
}
?>
</div> |