Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,151,665 members, 7,813,228 topics. Date: Tuesday, 30 April 2024 at 09:03 AM |
Nairaland Forum / Science/Technology / Webmasters / Rotating Banner Content (811 Views)
Please I Need A Solution For Rotating Ad Banners (2) (3) (4)
(1) (Reply)
Rotating Banner Content by Jovie: 1:17pm On Aug 15, 2007 |
please i want to know how websites rotate the content of the banners on their pages, especially the home page. for example, in yahoo mail, whenever you open a mail, the banner content at the top of the page changes. How do they rotate the content? do they have different page designs or is it something advanced that I do not know? |
Re: Rotating Banner Content by my2cents(m): 2:20pm On Aug 15, 2007 |
here is one approach (you can do this using javascript or whatever back-end language you use): 1) create at least 3 graphic files and name them, say, 1.jpg, 2.jpg, 3.jpg and so on 2) generate a random number b/w 1 and the number of images you have 3) replace the, say, "1" in "1.jpg" with, using php say, "<?php echo $randomNumber; ?>.jpg 4) Refresh your page. If you implemented the code correctly, you should see the graphics switching out. I hope this helps. |
(1) (Reply)
Creativity With Flash / Problem Getting Into Yahoo Chat Room / Computer Institute
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 9 |