Jump to content

Changing banners


lemmy2314

Recommended Posts

here is one way to do that:save your images with names :image1.jpgimage2.jpg....image10.jpgthan add this

<?$number = rand (1,10);echo "<img src='images/image".$number.".jpg' >";?>

each time the page is reloaded a random image will be displayed

Link to comment
Share on other sites

I know it's 'cool' to have banner rotation and stuff, but I've noticed that on all sites that's got it, the site uses a long time to load...I had one too, so I changed to Flash and everything worked at once. I didn't even see the site load when I changed from banner rotation.

Link to comment
Share on other sites

Banner rotation doesn't cause a site to slow down. All you are doing (in the example above) is generating a random number and using that as part of the image name. There is nothing about that process that would cause a delay in the load, the entire process would take a very small fraction of a second. The new image might not be cached yet, but that's nothing to do with PHP.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...