Ver Mensaje Individual
  #2 (permalink)  
Antiguo 07/01/2010, 15:03
Avatar de mark_ant0n
mark_ant0n
 
Fecha de Ingreso: enero-2009
Ubicación: Comitan, Chiapas mx
Mensajes: 388
Antigüedad: 15 años, 3 meses
Puntos: 6
Respuesta: Problema con directorio de imagenes

Disculpa por no contestar antes:S, unas largas vacaciones y con eso que no checo mis mensajes privados, bien prueba con esto, espero todavia te sirva.:S

Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  4. <title>galeria dinamica</title>
  5. </head>
  6.  
  7. <form id="form1" name="form1" method="post" action="galeria.php">
  8. <table width="750" border="0" cellspacing="0" cellpadding="0">
  9. <tr>
  10. <td><select name="galeria" id="select">
  11. <option>Seleccione una galeria</option>
  12. <option value="animales">Animales</option>
  13. <option value="paisaje">Paisajes</option>
  14. <option value="otros">Otros</option>
  15. <input type="submit" name="button" id="button" value="Cargar_galeria" /></td>
  16. </tr>
  17. </form>
  18. <table width="750" border="0" cellspacing="0" cellpadding="0">
  19. <tr>
  20. <td>
  21. <?
  22. if(isset($_REQUEST["button"])){
  23. $carpeta = "imagenes";
  24. $subcarpeta = $_POST["galeria"];
  25. $dir = opendir($carpeta."/".$subcarpeta."/");
  26. while($leer = readdir($dir)){
  27. echo "<img src='$carpeta/$subcarpeta/$leer' />";
  28. }
  29. closedir($dir);
  30. }else{
  31. echo "Por favor, seleccione una opción.";
  32. }
  33. ?>
  34. </td>
  35. </tr>
  36. </body>
  37. </html>

Lo mas rapido que puedo ver es que, en $_REQUEST['name_del_boton'], debes de recibir el nombre del boton, si gustas hacerlo de esa forma
__________________
"Diseño de software a la medida"

http://www.sadhoc.com