#Uso rand impostando come limiti 1 e 4 $spot = rand(1,4); <#Creo uno switch impostando $spot come condizione #Ovviamente creo 4 case... switch($spot) { #Se $spot è uguale a 1... case "1": $pic = "banner01.gif"; $link = "http://www.mrwebmaster.it"; break; #Se $spot è uguale a 2... case "2": $pic = "banner02.gif"; $link = "http://www.bannergratis.it"; break; #Se $spot è uguale a 3... case "3": $pic = "banner03.gif"; $link = "http://www.mrw.it"; break; #Se $spot è uguale a 4... case "4": $pic = "banner04.gif"; $link = "http://www.wmstats.it"; break; } #Uso print per stampare un po' di codice Javascript #che serve per l'invocazione del banner scelto randomicamente print "document.write('