lemmy2314 Posted February 25, 2007 Share Posted February 25, 2007 i want to have banners on a page but i'd like the banner to change to a differnt one, is this posable and if so could you show me howMany thanks again Link to comment Share on other sites More sharing options...
Lulzim Posted February 25, 2007 Share Posted February 25, 2007 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 More sharing options...
pterodactyl Posted February 26, 2007 Share Posted February 26, 2007 Try this tutorial. Link to comment Share on other sites More sharing options...
Anders Moen Posted February 26, 2007 Share Posted February 26, 2007 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 More sharing options...
justsomeguy Posted February 26, 2007 Share Posted February 26, 2007 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now