Ver Mensaje Individual
  #3 (permalink)  
Antiguo 05/05/2010, 07:46
maxwellxp
 
Fecha de Ingreso: abril-2010
Mensajes: 143
Antigüedad: 14 años
Puntos: 0
arreglado
Código PHP:
Ver original
  1. <?php
  2. if(isset($_POST['enviar'])) {
  3. $img1 = $_FILES['img1'];
  4. $img2 = $_FILES['img2'];
  5. $img3 = $_FILES['img3'];
  6. $img4 = $_FILES['img4'];
  7. $numbanners = 4; //numero de banners que se rotarán
  8. $random = rand(1,$numbanners);
  9.  
  10. $img = array();
  11.  
  12. $img[1] = $img1;
  13. $img[2] = $img2;
  14. $img[3] = $img3;
  15. $img[4] = $img4;
  16. }
  17. echo "<img src='$img[$random]'>";
  18. ?>
pero no me salen las imagenes q cargo

otra cosa, abriendo directamente desde sitio pasa esto:
Código PHP:
Ver original
  1. Notice: Undefined variable: random in C:\wamp\www\banner\sitio.php  on line 17
  2.  
  3. Notice: Undefined variable: img in C:\wamp\www\banner\sitio.php on line 17
necesito q aparezcan los banners aleatoriamente

Última edición por GatorV; 05/05/2010 a las 08:01