Allen Lawson Posted February 6, 2012 Share Posted February 6, 2012 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 More sharing options...
Don E Posted February 6, 2012 Share Posted February 6, 2012 Well.. it can be done with JavaScript.. check out this link to get an idea: http://www.w3schools.com/dhtml/tryit.asp?filename=trydhtml_randombanner Link to comment Share on other sites More sharing options...
davidb52 Posted February 6, 2012 Share Posted February 6, 2012 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 More sharing options...
thescientist Posted February 6, 2012 Share Posted February 6, 2012 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 More sharing options...
Allen Lawson Posted February 8, 2012 Author Share Posted February 8, 2012 Yea, sorry about that but like it says above my pic - NEWBIE lol Thanks for the replies Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.