Rotation bannieres pub en html

Résolu/Fermé
deejays - 26 déc. 2010 à 18:04
 deejays - 26 déc. 2010 à 18:45
Bonjour,
je recherche un script en html simple pour faire une variation de mes bannières de pub toutes les 25sec.
merci de votre aide.



2 réponses

MastercroW Messages postés 1095 Date d'inscription dimanche 3 octobre 2010 Statut Membre Dernière intervention 31 mai 2019 163
26 déc. 2010 à 18:11
Bonsoir,
J'ai trouvé un script en PHP plutôt sympa sur internet, j'espère que cela vas t'être utile. Par contre sa ne varie pas toute les 25 secondes, mais à chaque rafraîchissement. Ce qui est tout autant sympa.
<?php
 
/****************************************************
    Tableau associatif des bannieres et banniere choisie
*****************************************************/
$tabBannieres = array(
 
    1 => array('http://www.site1.com','1.png','Description  1'),
    2 => array('http://www.site2.com','2.png','Description 2'),
    3 => array('http://www.site3.com','3.png','Description 3')
);
 
/****************************************************
    Détermination de la banniere à afficher
*****************************************************/
$choix = 1;
$choix = array_rand($tabBannieres, 1);
 
/****************************************************
    Affichage des bannieres
*****************************************************/
echo '<a href="', $tabBannieres[$choix][0] ,'" title="', $tabBannieres[$choix][2] ,'">';
echo '<img src="', $tabBannieres[$choix][1] ,'" alt="', $tabBannieres[$choix][2] ,'" />';
echo '</a>';
 
?>

0
merci MastercroW sa me conviens bien ce script
0