<?php
$numbanners = 4 ;
$random = rand(1,$numbanners);
$img = array();
$url = array();
$txt = array();
$img[1] = " http://www.tuweb.com/banner1.gif ";
$url[1] = " http://www.tuweb.com ";
$txt[1] = " Mi Sitio Web! ";
$img[2] = " http://www.tuweb.com/banner2.gif ";
$url[2] = " http://www.tuweb2.com ";
$txt[2] = " Tu Sitio Web 2! ";
$img[3] = " http://www.tuweb.com/banner3.gif ";
$url[3] = " http://www.tuweb3.com ";
$txt[3] = " Tu Sitio Web3! ";
$img[3] = " http://www.tuweb.com/banner4.gif";
$url[3] = " http://www.tuweb4.com ";
$txt[3] = " Tu Sitio Web4! ";
echo "<a href='$url[$random]' target=' _blank '><img src='$img[$random]' alt='$txt[$random]' border=' 0 '></a>";
?>
(27 Feb, 2011, 12:52 pm)Tozja escribió: Bueno antes de darte repu, puedo añadir mas copiando un codigo de los 4 y cambiando el 4 por mas numeros no?jeje, claro solo tienes que cambiar el $numbanners = 4 ; añadiendole al 4 los que quieras y luego añadir
<?php
$img[1] = " http://www.tuweb.com/banner1.gif ";
$url[1] = " http://www.tuweb.com ";
$txt[1] = " Mi Sitio Web! ";