Jump to content

How to display random banners?


Allen Lawson

Recommended Posts

Hey there,I was wondering how at times Wikipedia displays that banner at the top of every page when they want one to be there. I use php inlcudes for my website but I know thats probably not what there using because sometimes there is no banner. I guess another great example would be how YouTube sometimes haves alerts for new things going on at the top. Any thoughts / how to do this would be great!Thanks,Allen Lawson

Link to comment
Share on other sites

or php,create a array with pages something like (just the idea)

<?php$pages = array(index.html,test.html,more.html,nothing.html);?>

now create a random numberbecause we have 3 array items$i = rand(0,3);and show the page by:include("$pages[$i]"); if you want a blank page:if($i==3){// do nothing}else{include("$pages[$i]");}

Link to comment
Share on other sites

Hey there,I was wondering how at times Wikipedia displays that banner at the top of every page when they want one to be there. I use php inlcudes for my website but I know thats probably not what there using because sometimes there is no banner. I guess another great example would be how YouTube sometimes haves alerts for new things going on at the top. Any thoughts / how to do this would be great! Thanks,Allen Lawson
there's really only a need to ask a question oncehttp://w3schools.invisionzone.com/index.php?showtopic=41762 If you are unsure of which forum it should go, put it General. A mod can always move it if need be. Double posting is unnecessary and confusing, and spreads the discussion out over multiple threads instead of one thread where all relevant contributions/comments can be read by everyone.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...