Foros del Web » Programando para Internet » PHP »

ayuda para rotacion de banners

Estas en el tema de ayuda para rotacion de banners en el foro de PHP en Foros del Web. buenas q tal, estoy teniendo problemas con un codigo para rotar banners, queria ver si alguien tiene un codigo para rotar banners sencillos....
  #1 (permalink)  
Antiguo 06/04/2003, 18:34
 
Fecha de Ingreso: abril-2003
Ubicación: Panama
Mensajes: 3
Antigüedad: 21 años
Puntos: 0
Mensaje ayuda para rotacion de banners

buenas q tal, estoy teniendo problemas con un codigo para rotar banners, queria ver si alguien tiene un codigo para rotar banners sencillos.
  #2 (permalink)  
Antiguo 06/04/2003, 18:37
Avatar de sdf23  
Fecha de Ingreso: diciembre-2002
Mensajes: 297
Antigüedad: 21 años, 4 meses
Puntos: 0
aqui esta
Código PHP:
<?
$numbanners 
//numero de banners que se rotarán
$random rand(1,$numbanners);
$img = array();
$url = array();
$txt = array();

$img[1] = "archivos/banner1.gif";
$url[1] = "http://www.enlace1.com";
$txt[1] = "Visita el enlace del banner 1";

$img[2] = "archivos/banner2.gif";
$url[2] = "http://www.enlace2.com";
$txt[2] = "Visita el enlace del banner 2";

$img[3] = "archivos/banner3.gif";
$url[3] = "http://www.enlace3.com";
$txt[3] = "Visita el enlace del banner 3";

//si quieres añadir más deberás utilizar la siguiente estructura y definir el número de banners a rotar en la parte superior, en la variable $numbanners.

$img[x] = "banner.gif" //url de la imagen
$url[x] = "http://www.enlace.com" //url del sitio web
$txt[x] = "Visitanos!" //texto ALT

echo "<a href='$url[$random]' target='_blank'><img src='$img[$random]' alt='$txt[$random]' border='0'></a>";
?>
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 10:51.