Ver Mensaje Individual
  #2 (permalink)  
Antiguo 15/12/2010, 10:43
Avatar de GatorV
GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 18 años
Puntos: 2135
Respuesta: Como poner un php que genera una imagen aleatoria en mi html

Cuales etiquetas? Eso que tienes lo puedes poner donde quieras:
Código PHP:
Ver original
  1. <html>
  2. <head>
  3. <title>test</title>
  4. </head>
  5. <body>
  6. <?php
  7. $conexion = mysql_connect("localhost", "pruebas", "pruebas");
  8. mysql_select_db("pruebas", $conexion) or die (mysql_error());
  9.  
  10.  
  11. $intruccion = "SELECT * FROM productos_sin_dvd where subfamilia = 'aceites' ORDER BY RAND()LIMIT 1";
  12. $resEmp = mysql_query($intruccion, $conexion) or die(mysql_error());
  13. $nfilas = mysql_num_rows($resEmp);
  14.  
  15.  
  16. if ($nfilas> 0) {
  17. while ($rowEmp = mysql_fetch_assoc($resEmp)) {
  18. echo '<img src="'.$rowEmp['imagen_buimagen_or'].'"<br>';
  19. }
  20.  
  21. }
  22.  
  23. ?>
  24. </body>
  25. </html>