PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
<div id="photo">
<?php include 'banner.php'; ?>
</div>
The problem is that when I load my page, I can see the first add selected from the list but it doen't refresh it( I mean it keeps that add only until when I refresh my page). When I hit refresh or reload button it picks another advert. now, How can make rotating through all the adds without hitting refreshing or using <META REFRESH > tag?
Thank you.
Last edited by Benjamin on Tue May 26, 2009 10:29 am, edited 1 time in total.
Reason:Added [code=php] tags.
1. Yes, you need to use a refresh mechanism to have the banners rotate, but this will effect in the entire site reloading over and over again. Therefor some JavaScript (Ajax) or (uglier but easiest) add an iframe of the same size of your banners to the page that should contain the adds. That way you can have the banner reload automatically without reloading the page.
2. A nicer way to do this banner rotation thing is by adding the data to an array. That way it's cleaner and you can grab a random banner more easily.
I don't want to change any thing to my banner, I am looking on how I it can rotate. you are suggesting me to use iframe, can you show me the example? just how to call my addrotator code and how to refresh it.
I appreciate your help.
Regards,
Last edited by Benjamin on Tue May 26, 2009 10:30 am, edited 1 time in total.
Reason:Removed [quote] of entire op.