Jump to content
Allen Lawson

How to display random banners?

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

Share this post


Link to post
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]");}

Edited by davidb52

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...