Ver Mensaje Individual
  #7 (permalink)  
Antiguo 23/12/2004, 03:18
Avatar de KarlanKas
KarlanKas
Moderador extraterrestre
 
Fecha de Ingreso: diciembre-2001
Ubicación: Madrid
Mensajes: 6.987
Antigüedad: 22 años, 5 meses
Puntos: 61
Prueba con esto:
Código HTML:
<html>
<head>
<title>Listar</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>


<body leftmargin="0" topmargin="0">

<table width="50%" border="0" bordercolor="#006600" bgcolor="#ff0000">
<?
//Lista los archivos existentes en el directorio
$directorio=".";
$manejador=opendir($directorio);
$lista="";
while ($fil = readdir($manejador)) {
if ($fil != "." && $fil != "..") {
$lista.="'".$fil."',"; 
}}
closedir($manejador);
$lista.="''";?>;

<script type="text/javascript">
nombre=[<?echo $lista;?>];
for(a=0;a<nombre.length-1;a++){

document.write("<tr>\n")
document.write('<td width="60%"><font color="#ffffff" size="2" face="Verdana, Arial, Helvetica,sans-serif"><strong>'+nombre[a]+'</strong></td>\n');
document.write('<td width="10%"><input type="button" id="b" value="Escuchar" onClick="alert(nombre['+a+'])"></td>\n');
document.write("</tr>\n");
}
</script>

</table>
</body>
</html> 
__________________
Cómo escribir

No hay pregunta tonta, sino tonto que quiere seguir en la ignorancia.