Ver Mensaje Individual
  #2 (permalink)  
Antiguo 07/07/2003, 12:55
chivi
 
Fecha de Ingreso: diciembre-2001
Ubicación: Madrid
Mensajes: 889
Antigüedad: 22 años, 4 meses
Puntos: 4
Yo hice este para mi web:

Código PHP:
<?
srand
((double)microtime()*100000000);
$total "X"//Dónde X la cantidad de banners que se rotarán
$numero rand(1,$total);
$banner = array();
$height = array();
$width = array();

$tipo[1] = "swf"//Extensión del primer banner
$banner[1] = "banner1.swf"//nombre del banner y su extensión
$height[1] = "68"//alto del banner
$width[1] = "450"//ancho del banner

$tipo[2] = "jpg";
$banner[2] = "banner2.swf";
$height[2] = "68";
$width[2] = "450";

//luego va el [3] luego el [4] etc...

if($tipo[$numero] == swf){
echo 
"<param name=movie value='$banner[$numero]'>";
echo 
"<embed src='$banner[$numero]' type='application/x-shockwave-flash' width='$width[$numero]' height='$height[$numero]'>";
echo 
"</embed>";
}else{
echo 
"<a href='$url[$numero]' target='_blank'>";
echo 
"<img src='$banner[$numero]' alt='$alt[$numero]' width='$width[$numero]' height='$height[$numero]'>";
echo 
"</a>";}
?>
¡Saludos!

PD: En mi página puedes ver que funciona sin prolemas (está en mi firma xD)

Última edición por chivi; 07/07/2003 a las 12:58