Placed in: Home
PHP Random Image Rotation

Want some randomness on your website? Try out this PHP image rotator. This script will display a random image every time the user re-loads the page or starts navigating. A very nice effect that can help you make your website a little bit more interactive.

PHP Random Image Rotation

This script can be perfectly used for a banner of header on your website. You can also use this in your signature or avatar on a forum. Additionally, you can rotate HTML and CSS files. Just make sure this script is placed on a PHP server, otherwise it will not work.

Demo

Simply refresh the current page and see the image below changing each time. The image is chosen randomly. You can also visit the demo page Demo for a lightweight demo page.

Installing on your site

To install the script, simply download it and place it in any folder of your server. In the default configuration, all images from the folder where the script is located are used.

Example:

  1. images/header/rotate.php
  2. images/header/abstract.jpg
  3. images/header/bird.jpg
  4. images/header/butterfly.jpg
  5. images/header/happy.jpg

Now direct the source to the PHP file and you're done.

<img src="images/header/rotate.php" alt="Header" width="400" height="100" />

That's it. Now any random image file located in the same directory as the script will be displayed.

Advanced configuration

  • $folder = '.';

Change this variable in the script to locate the directory where your images are placed. When the default is selected, the script wil randomly use any image file that is located in the same directory as the script.

  •     $extList = array();
      $extList['gif'] = 'image/gif';
      $extList['jpg'] = 'image/jpeg';
      $extList['jpeg'] = 'image/jpeg';
      $extList['png'] = 'image/png';

In this variable you can set which image types are used. For example, remove all the default $extList values and add a $extList['css'] = 'text/css';. Now a random CSS file be selected. This way, you can play a little bit with your websites CSS, making it fun for the visitor every time he reloads the page. You can actually random any file you want.

Attached files:

SourceDownload Source

DemoView Demo

Enjoy and good luck using this script. Where are you going to use it for?


Tags:  php webdesign image rotate script

Interested in this topic? You might enjoy another article I've written called

Did you like this article? Subscribe to my feed or email to keep updated on new articles.

Spread the word and submit to:
Digg!Reddit!Del.icio.us!Facebook!StumbleUpon!
Comments
Add NewSearchRSS
Ricardo - Give some color   2008-01-21 18:34:03
Gravatar image Hey Marco.
Nice stuff here ;) very useful.
One question, can I change BG color or something like that?
Marco - Thanks   2008-01-21 19:04:20
Gravatar image Hey Ricardo,

Thanks, hope you like everything.

What do you mean with changing the background color?

With this script you could rotate the CSS file or the image file for the background, if that's what you mean.

Greetings,,,
lock - Link   2008-01-27 02:34:58
Gravatar image Hi,

Excellent stuff. Just wondering if it's possible to turn the image to a link, make it clickable etc?

Regards
Marco - Yes, it's possible   2008-01-27 09:46:47
Gravatar image Hello lock,

Of course it's possible to turn the image into a link. Just use the following:
<_a href="http://www.LINK.com"><_img src="rotate.php" border="0" />
(Remove the underscores "_" )
That should work!

Don't forget the "title" and "alt" attributes if you want to make it W3C valid.
Lisa - Adding a link to rotate.php   2011-02-21 00:07:04
Gravatar image Hello,
I am trying to add a link to my logo rotate.php and I can't get it to work.
Yes I am very new to this...I need my hand held a little :(
heres what I have:

.logo { background: url(images/logo/rotate.php) no-repeat; margin: 10px; padding: 0; width: 465px; height: 255px; border: 5px groove #666b18; }

Where would I add:

(Remove the underscores "_";)


After removing the underscores and changing the URL address?

Thank you for your help.
Lisa   2011-02-21 00:10:26
Gravatar image oops the script from you did not show up.
It should of read:

Where would I add:
[color=fuchsia]
(Remove the underscores "_" )[/color]
Oliver - Link to different images   2011-06-05 18:48:55
Gravatar image Hello Sir

Thanks for this,
I'd like to ask how I can set the code for images to link to a web-page.

eg. image1.jpg when clicked go to website1.com
image2.jpg when clicked go to website2.com

Thanks
watkino - I'm sorry, where should the HREF tag go?   2011-06-15 17:34:10
Gravatar image Just downloaded the wonderful PHP script. Curious, where should the HREF tag be inserted into the default script?
Abhimanyu - Different Image, Different Link..   2011-11-15 21:31:15
Gravatar image :dry: Can different images have different links?
Kevin - Link to full size image   2012-02-24 17:53:01
Gravatar image I have tried what you suggested "
(Remove the underscores "_" )" (used my domain name of course). But, it just opens up my web site again. Is there a way to link to the current random image and display it full size so that someone can download the image if they want?
Any help would be appreciated.
Dave - mcrmy   2012-08-30 20:35:43
Gravatar image i see we can add a link to the images but what if we want different images and each image is a different sponsor and therefore needs a different linking URL? how is that done? I don't see a way to do this.. please help..

dave
Joshy K (jsa005) - Just rotate a HTML file!   2013-01-03 22:13:18
Gravatar image Simply use HTML files, and instead of src="rotate.php" or something, where you want the image, [code][/code]
Add the image code in the HTML files.
lock - Link for different images   2008-01-27 21:06:30
Gravatar image Hello Marco,

Thanks for the reply. Im just wondering if I could specify a different link for each image? For example, there are 5 images in the folder and I want different link for each one when they show up. Hope that makes sense.

Also, how do I implement the title and alt attributes within the code?

Regards
Marco - Not possible (yet)   2008-01-27 21:56:47
Gravatar image Hello Lock,

Great question. This functionality isn't provided with the script, but when I have time I'll maybe create one that'll suit your needs.

Additionally, as you read the documentation, you could also rotate HTML files (IFRAME). If you have the image and link located in the HTML placed correct, it should be able to work.

ALT and TITLE:




Greetings,
Fenil - My Website   2011-10-13 04:36:35
Gravatar image Sir,plz Send me the whole code of rotation of images...
Karen - MSIE / Firefox acting differen   2008-01-27 22:43:16
Gravatar image Hi Marco,

I know very little about php, but am trying to make random images work on a site for a friend.

I've inserted rotate.php on every html page of the site at http://www.bodydesign.ca/draft.html When I visit it with MSIE and Firefox, and click on the links in the expanding menu, every page has a random image displayed in Firefox, but MSIE repeats the same image regardless of what link you choose. The picture only changes when you refresh the page.

Any suggestions how to get the site to have random headers throughout every page, in both browsers? Thanks in advance for any help.

Karen :o)
Marco - Stupid IE   2008-01-28 10:00:39
Gravatar image Hello Karen,

Pretty strange, but you're right. I really don't know how this comes, since I tested it before with IE and it worked.

I'm guessing it has something to so with your "mapping" over the logo or the pagenavigation.

The script itself works perfect in IE:
http://www.bodydesign.ca/banners/rotate.php

Hope you can make this work!

Greetings,
Anonymous   2009-10-24 08:00:59
Gravatar image hello
this is reza. I want to link images saved in a folders with other data from mysql....in a tabular projection....please help me with php code... May Allah bless u....thanks..

my email: humayon5232@yahoo.com
josh   2009-12-24 16:34:17
Gravatar image I have the same problem with IE. The image is randomized on the initial visit, but after that, no rotation occurs. This happens for a few of the new versions of IE (6+). Firefox works fine.
bogdanl - change background color   2008-02-02 21:28:56
Gravatar image Hi!

First of all this is a very nice script. I just want to change the color of the background in white or black depending on the image that is loaded. So i have two images: one with white background and one with black background. When the image with white background color has loaded i want the background of the page to be white too...same with the image with black background color.
It's possible?
Thank you!
Marco - Only with CSS   2008-02-04 10:03:10
Gravatar image The only way to do this, is by rotating the CSS file.

In the "white.css" you have the template with the white background and the white image.

In de "black.css" you have the template with the black background and the black image.

Now use rotate.php to rotate between "white.css" and "black.css".

Good luck.
DaniloH   2008-02-14 20:37:36
Gravatar image Niiiice! ;)
Anonymous   2008-02-22 19:25:22
Gravatar image Lovely, just what I needed :woohoo:
gugu - gugu   2008-02-24 16:27:29
Gravatar image Hi
i need to lear a simple hpp image rotate script that wil run on second basis , i wan to display ads at 10 seconds intervals
i've worked WITH $SECOND thing to display a different image at different $sec variables but images jus don pop up without refreshing refreshing the page
please assist
Jeff - Thanks for this mate!   2008-03-30 05:12:38
Gravatar image Thanks for this mate! I added your rotate.php code (renamed to header_logo.php) and then I used this .htaccess code to change it into a .png extension:
RewriteEngine On
RewriteRule ^.*$ header_logo.php

Works like a charm. Previous code I used gave garbled text when I 'view image' with firefox. This does not produce this error. Thanks!
Neville - Problem   2008-04-03 17:10:15
Gravatar image :woohoo:
Great script you got, but i'm having trouble implementing it.
look at http://www.czuobjects.com/idgirl/index.php and you will see the results i get.
please help.
chetan - php quesion   2008-04-10 12:20:54
Gravatar image hi, i am new with php.
I am get success that upload image and store image with full size as well as thumbnail with different folders. And i can also save the path in the database in which image is save. I have problem that i can show that image sequentially in the webpages by using that db path or directly from that folder. I will try lots of thing but i can't see any solution. So please help me to solve that problem. Or any script is their to solve that problem
thank you:cheer:
Steve - Link images   2008-04-25 01:41:03
Gravatar image I read what you said about making an HTML page to make images linkable but it still doesn't work for me. Can you PLEASE provide an example of an rotatable HTML file, preferably with an image inside linking to another page? I tried IFRAMES -- EVERYTHING! But it just won't for me. :(
Allen Craig   2011-07-18 17:34:38
Gravatar image see my comment above
Hardley - Rotating different Websites   2008-05-07 08:33:26
Gravatar image may someone help with a script that i can use to rotate different website after an interval, say 10 sec or so.

kind regards

Hardley
satea   2008-05-23 03:43:05
Gravatar image is it possible to configure the script so only get the images that end with "_s.jpg" from the given folder?

I have all of my images in the same folder, but thumbs end with _s.jpg and want to get randon from them, not all fo the images.
Milo - doesn't work in IE   2008-06-10 10:56:07
Gravatar image Anyone know how to get this to work in Internet Explorer - the rotation of images only seems to work if you stay on the same page and actaully hit the refresh button...if you've got this script on everypage of your site and you want a random image selected each time you visit a page - works fine in Firefox, but in IE it seems to pick one image and then doesn't matter how many other pages you visit, it doesn't change the image unless you refresh the page by clicking the refresh button
Bobby   2008-10-02 20:34:00
Gravatar image If you're using this script across an entire site, it may load one image and cache the rotate.php file without loading a new image for the rest of the pages.
In ie, you'll actually have to click the refresh button to display a new image. This is troublesome for those who intended to display a random image on each page of their site.
To fix this, you may want to add php header functions directly to the script to ensure that your rotate.php file doesn't get cached with a static image across an entire site.
I added the following to the top of the rotate.php code: header("Cache-Control: no-cache";);
It might also help if Marco understood his own script.
Slant Media - Curious   2008-11-23 23:31:45
Gravatar image Would you have any idea how to get over the problem associated with loading this script into multiple image tables on a single page (i.e. we were hoping to be able to create multiple image rotations in various area of a single page) - We created multiple image folders, named the rotate script: rotate1.php, rotate2.php, etc) and we called that from within the folder of images where it resides...

The page seems to stop loading images after the first couple have loaded - or it works intermittent (at best) - Any ideas?
jesse hoff   2009-01-12 12:30:58
Gravatar image Couldn't get it to work in ie, wasn't sure where to put your code exactly. Not very familiar with php, could you spell it out for me where to put it exactly?

Thanks, Jesse
socrates   2010-08-16 21:00:58
Gravatar image The header("Cache-Control: no-cache";); line worked for me to fix the IE not-rotating issue, placed right under the "
Randomness   2008-06-23 06:41:29
Gravatar image What do I need to change to make this work with two random images side by side, without both being the same image?
Niles - perfect   2008-09-12 03:55:21
Gravatar image this was exactly what i was looking for.
i didn't want to clutter up the rest of the code with a bunch of javascript and now i don't have to. thank you.
Preston - thank you!   2008-09-13 19:50:20
Gravatar image nice work. i spent an entire day trying to get a previous script to work in FireFox. cheers!
Panchus - how to?   2008-10-30 17:45:08
Gravatar image Hello, Im trying to use this script but I cant figure out how.

My site have a header I would like to rotate. www.eduteca.com.ar

is the header with the illustration.

Where in joomla code should I put the code????

Im not programmer, thats the prob...

thanks in advance.
Derek C - Joomla?   2008-11-12 00:23:38
Gravatar image I'm also trying to configure a PHP image rotator as a background image within a Joomla template's style sheet. It looks like it's not allowing the PHP script to run its course.

This is the style for the rotator in the Joomla template's CSS:

#logo {
background:url(../images/rotator/rotate.php);
background-repeat:no-repeat;
background-position:bottom right;
position:absolute;
top:210px; left:30px;
width:462px; height:80px;

}

The directory and dimensions are perfect. The template just isn't calling on the script for some reason.

Any ideas?
Degas - How to use this scrip in css   2008-11-02 22:56:51
Gravatar image Hi,

How can i call the php file from a css insead of html?

Thanks a lot
Thomas - Multiple Directories   2008-11-14 19:33:43
Gravatar image Hey great script!

quick question:

im trying to use this script to pull images from multiple folders. I could easily just make copies of the images in one directory labeled "random" but I would like to keep them in their seperate folders to make updating easier on the people uploading the images (who will not be me)

I dont know if this is even possible, but if it is please let me know, thanks!
Kyle   2009-05-30 21:56:05
Gravatar image If am looking for a similar function. I have many folders from different users and I would like to have a random script that would search all these folders to make life easier.

I would also like a recent photos script displaying newest added photos from those folders as well.

I appreciate any insight, thank you in advance.
rony   2008-11-27 16:30:57
Gravatar image hey it's a nice one thank u.
kilroy - How to make the script just scroll images top to b   2008-12-03 02:45:28
Gravatar image How can I make the script just scroll thru the images from top to bottom.. the random is nice.. but Id like it ordered
Mike   2008-12-10 05:24:55
Gravatar image I'm having an odd issue where the images are rotating on refresh, but not fully loading. When I switch tabs or windows in my browser, then come back, the image is fully loaded perfectly. I'm using .png images. The only one that loads perfectly is a single .jpg (however, my other jpgs have the same problem as the .pngs). Oh, I'm using Firefox, by the way.

It's important that I use .pngs as I need the images to have transparency.

Any ideas?? Thanks
GGroup   2008-12-26 18:36:54
Gravatar image Hey Mike,

I'm having the same incomplete image load with Firefox and IE. Any word on the fix to get the header to fully display each time?

Thanks!
Jamie - Full image load problem.   2009-07-01 11:18:28
Gravatar image Did anyone get the FF full image load to work?!
Adam - Question   2008-12-10 10:02:21
Gravatar image great work, but is it possible to rotate more than one image on the website, I've tried and can only get the same image multiple times?
Cal - It works, and then it doesnt?   2008-12-18 21:42:21
Gravatar image hey. please can someone help me. it seems to work, and then randomly not work. some pages will rotate images and then just not display anything on the next page. im using it to change quotes on my site. the quotes are obviously jpegs. check out www.ebtsa.co.za.

thanks please help.

THANKS
Cal   2008-12-18 21:53:58
Gravatar image okay dont worry i got it working!!!!!!! my bad ... i made a school boy error ...

thanks for the awesome script!
jesse hoff - I can't get it to work   2009-01-12 11:14:30
Gravatar image Hey everyone,

Need a little help here, I'm not sure what I'm doing wrong. I've inserted the php file into my image folder, it's on the server but I'm still not getting a random image to come up. There's definitely more images in that folder, not all the same size though. Using freehostia.com as a web host. Any help would be appreciated.

Thanks, Jesse

jessehoff.com
jesse hoff - Never mind   2009-01-12 11:17:55
Gravatar image I just got it to work, sorry about that

Jesse
krud - Image name   2009-02-04 06:15:32
Gravatar image Hi there.
Great script! I love it.
I have a site with several thousand images. Is it possible to display the name of the image below?
I've tried 'print $img;' and 'echo $img;' within the php script, to no avail.
Thanks.
James - Image Transitions   2009-02-27 21:09:10
Gravatar image I really appreciate this script it is exactly what I was looking for. I would however like to change the transition effect from a top to bottom swipe to a fade.

How might I modify this code to do that?

Thank for the help.
PeteFriday - Change on page load   2009-03-10 11:59:20
Gravatar image Hiya,

great script. I use it in a css file so my background image changes. But it only changes when the refresh button is used. I want the background image to change every time my website is visited. How can i do this?
I see a lot of questions not awnsered, i really hope someone can help!

Thanks!
Nockadile - n/a   2009-03-26 02:08:10
Gravatar image I love your site, demos & image rotator. You didn't by chance build a version that allows a link from each image did you? I could really use something like this.
Christian Haugen - Works perfectly in Firefox but not in IE   2009-03-29 08:07:22
Gravatar image Excellent script man! But somehow it doesn't work in IE, just shows a blank spot where the picture should be. Why does it work in Firefox and now in IE?

Check out my webpage http://www.175days.no to see for yourself :)
Vinicius   2009-03-29 19:50:48
Gravatar image Thanks!!!! :lol:
Mozack - Load more that 1 image   2009-04-02 14:36:42
Gravatar image Hi man,

Thanks for this great script, just 1 question:

I have one wordpress blog and i want to put 1 diferent image after each comment, how can i do that? it shopuld load more that 1 diferent image in same time:

I changed my comments.php and after keep one
Eddy Matthews   2009-04-14 10:53:17
Gravatar image I'm using this script and it works perfectly, but I'd like to add a feature if someone can help please?

Is it possible to have the script display the filename that is being displayed, but WITHOUT the extension?

For example, if I had a directory that contained the following images:

filename1.jpg
filename2.gif
filename3.jpeg

Can I have it so the when the image is displayed, it has a text at the top that says "filename1", or "filename2", and then display the image below that?

php is totally new to me, so ANY help would be very welcome!

Regards
Eddy
l33tCodeChick - Multimedia Production Specialist   2009-05-03 11:12:34
Gravatar image I have been searching high and low for this, but there is one teeny bit of info missing:

In my html, how do I reference it so that I have rotating html pages? I am quite aware of the array used in the php file to reference the html page (I have some php experience) . . . but now how do I make it display!

For the image rotate you reference image tags < img src = " # " > in html on the html page. How do I reference so I have rotating html pages!
Ben Taylor - Thank dude!   2009-05-20 15:25:25
Gravatar image Hey man,

Just thought I'd let you know, worked a treat straight out of the box.. nice one man, very easy script to use.

Ben
Joel - thanks!   2009-06-01 17:47:18
Gravatar image Hey! Thanks for your code. It was simple and perfect, as the best things in life!
Hanneke   2009-06-04 14:54:50
Gravatar image i was just wondering what i have to add to the head-part of my html to get the css to switch? i can't seem to figure it out :(
Rob - IE Caching Fix to refresh images   2009-06-04 20:04:36
Gravatar image To fix the rotate.php caching problem in IE add the following line to the top of your script (under
Rob   2009-06-04 20:05:43
Gravatar image To fix the rotate.php caching problem in IE add the following line to the top of your script (under the first php line)

Code:
header("Cache-Control: no-cache, must-revalidate";);
Kelly - Quick Question   2009-07-14 06:18:36
Gravatar image I was wondering if it's possible to make the images change in a certain order. The only reason I ask is because I have it set to rotate the background image and sometimes it reloads the same image on refresh. For example, some kind of non-repeat clause. Everything else is flawless. Appreciate the help if you get a chance.

-Kelly
Paul - Configuration FIle   2009-08-06 19:18:04
Gravatar image Maybe I am clueless, but I could not figure out where I was supposed to place this configuration file.
Derek - Unsubscribe?   2009-08-07 03:21:03
Gravatar image I've tried to unsubscribe from these comments several times to no avail. Could you manually unsubscribe me? Thanks.
danny - Linking for different images   2009-10-14 07:43:47
Gravatar image Like mentioned by someone else, I also need to have a different link for each image.

I am using it for products and different images represent different images and links, would be great to implement it
Jim Stiner - I love the way you set up your Blog   2009-10-21 06:10:26
Gravatar image I own a restaurant guide in overland park ks and am trying to figure out the best way to monitize my site; www.overlandparkrestaurantguide.com

At first I was going to stack the listings; charge more for the first spot, more for the second, and less for the 3 spot

After thinking about it from a restaurant owners point of view, and ease of selling, I decided to list them vertically and rotate them. I put up two listings and left the third one blank.

I read that we read from left to right so trying to be fair to all 3 owners, I would charge the same price, make a clickable image, and put the move the image to third place, move second image to first place and move third image to second place each time the page refreshed.

From all the positive comments about your script, I know it has it;s place, maybe on my other restaurant guide that only list the best restaurants in Overland Park.

My question to you Ricardo and all the other posters present and future, is what I am wanting possible?

Do you know of a site that is set up to do what I am wanting to do?

Thanks

Jim Stiner
archna - manager   2009-10-22 17:03:43
Gravatar image Hello, I want to know how I can add rotating image slide show to my website, like hess.com has on their homepage,,

Please advise
thanks in advance!

archna
geehee - Image Links   2009-10-25 22:29:29
Gravatar image :idea:
I would do anything for some info on hose to do as mentioned a couple times above and make each img a unique link.
Thanks for any feedback!
wieyoga - Bali   2009-10-31 02:20:55
Gravatar image I really appreciate this script it is exactly what I was looking for. :woohoo: I would however like to change the transition effect from a top to bottom swipe to a fade.
gofree - Seeking!   2009-11-18 09:25:01
Gravatar image Really appreciate this - I have been seeking for ages.
gofree   2009-11-18 09:33:28
Gravatar image How about using with this:

background: url(http://www.looblog.com/adult/rotate/rotate.php) no-repeat;

How can I use title, link, and alt attribute?

Edit: m using it here: adultloo.info
victor - how to do it in iweb?   2009-11-19 04:11:33
Gravatar image Hi !

I am using iweb (I'm so green in html or other type of code) so, do you know how could I use this code in iweb? (first code)

Thank you!

Vic
josh - re:   2009-12-24 16:48:08
Gravatar image
josh wrote:
I have the same problem with IE. The image is randomized on the initial visit, but after that, no rotation occurs. This happens for a few of the new versions of IE (6+). Firefox works fine.


An update on that: the rotate.php works as it should in IE when I actually hit "refresh". However, if I simply click on the links to bring me to a new page (also with the rotate.php code) there is no rotation. In Firefox, this feature works regardless of whether the page is refreshed or loaded for the first time through a link.

http://www.ontariobadgers.com/badgers

Any suggestions? I imagine it's something simple, but my entire experience with php involves this file :)
Kazna - Hi   2010-01-05 18:14:35
Gravatar image Hi, I've just trod on air to find this script :) and i tried to use it as an avatar on my forum but i failed. Do you have any idea how to do it? It's ok if you don't :confused: thanks!
DimeDesign - Using it on my blog for the logo   2010-01-07 04:55:12
Gravatar image I'm going to be using this on my design inspiration blog to rotate between random logos that I've made. :)

I think it's a pretty creative idea.
kevin   2010-01-08 21:34:04
Gravatar image Awesome !!! THANK YOU so much for the script !!
Little Doe - Great job!   2010-01-09 19:24:48
Gravatar image Wow thank you SO much! I always have trouble using and understanding code demos I find on people's sites; but this one was a cinch! LOVE IT!
annieoad   2010-02-13 09:32:46
Gravatar image please send me code to randumly change the images in php
tommytomato - re: Yes, it's possible   2010-03-08 08:12:22
Gravatar image
Marco wrote:
Hello lock,

Of course it's possible to turn the image into a link. Just use the following:

(Remove the underscores "_" )
That should work!

Don't forget the "title" and "alt" attributes if you want to make it W3C valid.


Do you have the script or is it possiable to make each image click able to a different site each time?

TT
Fred - Thanks for the code   2010-03-13 21:31:34
Gravatar image It's useful
Vikas - Net2user   2010-03-16 13:49:56
Gravatar image Hi!

It's a good script but the images dose not populate somtimes it gets half open.
I have added the header code in rotate.php still you can see it for yourself
http://www.net2user.com

A further help to fix will be highly appreciated.

Thanks.

-Vikas
Nikkels - can the script be dropt in Joomla template?   2010-03-19 12:27:32
Gravatar image Hi there,

Nice script, see you also work with Joomla, can this script be dropt in a Joomla temple? I looked in the html file and the css files but couldn't find a place were to drop it:

HTML
















CSS
div.art-Header-jpeg
{
position: absolute;
z-index:-1;
top: 0;
left: 0;
width: 780px;
height: 200px;
background-image: url('../images/Header.jpg');
background-repeat: no-repeat;
background-position: center center;
sh3lls - I CANT GET THIS TO WORK AT ALL!!! :-(   2010-03-25 00:40:00
Gravatar image :( :( :(

What am i doing wrong?

Heres the HTML:





Untitled Document











Now the PHP





WHAT THE DEUCE??? Im running safari and the browser is clearly looking for an image because the little blue box comes up.. Its going to the right folder but just wont see the pics!!

SOMEONE HELP!!! Ive been fiddling with this for hours! and researching EVERYTHING i can find on creating this effect... This seems to be the easiest script available...
:( :( :(

THANKS!! In advance...
sh3lls - OK TRYING AGAIN!!!! HERES THE CODE!!   2010-03-25 00:41:16
Gravatar image










$folder = 'images';

$extList = array("pic1", "pic2", "pic3", "pic4";);
$extList['gif'] = 'image/gif';
$extList['jpg'] = 'image/jpg';
$extList['jpeg'] = 'image/jpeg';
$extList['png'] = 'image/png';
hjonakin   2010-03-28 23:25:46
Gravatar image Works great! Thank you so much! :lol:
jack - great stuff!!!   2010-04-01 16:54:38
Gravatar image hey, nice job dude :lol: :idea:
Martin   2010-04-17 21:14:56
Gravatar image Great work!! Very usefull and very simple. Thanks bro ;)
lawrence   2010-05-08 17:49:16
Gravatar image thank you for this beautiful piece of code. very useful indeed.

i'm going to use it here: http://www.caseydarnell.com
khaled   2010-05-22 20:06:34
Gravatar image hi, thanks for a great script, i am new with php script, i upload 10 jpg images including rotate php scrip all in one folder to the server, now how to do the rest please?
i did not understand the word source here,
direct the source to the PHP file and you're done.


thanks in advanced
Peter - LINK PER IMAGE   2010-05-25 20:36:44
Gravatar image Hello i didnt want to go through all the comments i think its just better to ask te question

Is it possible to have every image linked?

also does the script support .swf files?
Ross - Refreshing   2010-06-18 11:55:14
Gravatar image Hi all, I've had this script on my site for a little while now but I seem to be having the common problem of IE not refreshing the code and leaving me stuck with the same image as I move between pages and only giving me a new one when i physically refresh the page. I found the following piece of code in the comments here -

header("Cache-Control: no-cache, must-revalidate";);

I've tried adding it at the top of my rotate.php file just below the first php line but when I do none of my images load, I just get the dreaded red cross. Does anyone know what i'm doing wrong please. I'd love to get this working properly on my site.

Thanks
AK   2010-06-21 00:50:52
Gravatar image Thanks
Todd - Code to do same with quote?   2010-06-22 13:42:25
Gravatar image I would like to do the same in iweb, only with quotes. For example, quote by Abe, then refresh quote by George, etc. These would be from a set list. Any ideas how to do this? Please and thank you!!
Gouka Design   2010-07-09 08:43:59
Gravatar image Just what I needed, thank you :lol:
rymarchant - IE Fix   2010-07-16 07:01:36
Gravatar image Hey All,
Here's what worked for me to get the IE (anger inducing POS) working... this goes right at the top of the file after the
rymarchant   2010-07-16 07:06:31
Gravatar image Alright here's the code, it got cut out...

Right after the initial

[code]
rymarchant - Why won't this publish the code???   2010-07-16 07:07:37
Gravatar image
Code:
header("Cache-Control: no-cache, must-revalidate";);
rymarchant   2010-07-16 07:10:01
Gravatar image And again it displayed wrong...

It should be:

...must-revalidate, double quote, close bracket, then semi colon.

The forum software here is adding in an extra semi colon before the close bracket.

Hope this helps!

Ryan
Ross Loram - Thanks!   2010-07-21 12:27:03
Gravatar image It's working perfectly now, thanks Ryan! :woohoo:
Kent Sanchez - Page 1 to Page 2   2010-08-02 02:48:22
Gravatar image Dear Mr. Coder,

Is there any way possible that after a certain number of page views, that page 1 will go to page 2 and stay there permanently?

In php please, not all mobile devices support javascript without it being turned on.

-Kent Sanchez
Contact me a.s.a.p.
Can pay you for your time.
Marc J - pathinfo alternative?   2010-08-08 09:40:12
Gravatar image Thanks for a great script - thanks! Unfortunately my host installed suPHP and pathinfo (used 3 times in the script) is no longer supported. Is there an alternative / fix?
Briana Malmstrom - Owner-Rough Ride Creations   2010-09-29 21:15:25
Gravatar image Thanks for such a simple and useful script! I'm using it at the bottom of my hmepage to rotate various banners and it works perfectly. :cheer:
Briana Malmstrom   2010-09-30 04:03:49
Gravatar image Also, like others before have asked repeatedly, is there a way to make each image linkable to a different URL?

Thank you!
Frank   2010-10-18 20:34:02
Gravatar image Is there a way to put this on a timer where every 5 seconds the image changes?
Smashable - Smashable   2010-10-25 18:04:05
Gravatar image Worked great for me :D
Smashable - Smashable   2010-10-25 18:07:31
Gravatar image Though, it would be nice if it worked from a database?
Shutterclank - Using with Indexhibit   2010-11-13 18:19:10
Gravatar image Sup.

First, I like your php. this is a great script and well documented, etc.

Ive been trying to figure out how to do this, and it looks like you have an incarnation 10x better than i could ever do. I am trying to get it to work on an www.Indexhibit.org website, but when I put it on my site in the place where i have the image files and plug it into the main page it just loads an image of the question mark, ie it doesnt work.

the weird thing is, i load it onto my MAMP local site and it works like a charm.

do you know why this isnt working?
Luke - GroovyPoet   2010-11-16 02:48:51
Gravatar image Dude,

Thanks for the great tutorial it was just what I needed for my PHP board. I actually wrote a tutorial using your code on the phpBB forums. I cited your your website and gave you full credit.

http://www.phpbb.com/community/viewtopic.php?f=74&t=2110588&p=12896791#p12896791

If you have any issues with my tutorial just let me know, I'll make any changes you want, I'll even remove it if you request. But thank you for your work on this, it was most helpful.
John - image loading problem, keeps repeating   2010-11-17 20:26:02
Gravatar image ok, great script but i cant understand why nobody else has mentioned this.

It rotates the same image twice, then on the third or fourth page refresh only then does it show the other image, and again and againg it goes on, page refresh 3 times then it will show the other photo, so how can I get it to page refresh once then a new image appears?

Also, can I set it so that the most recent image added is the first seen on the initial page load?
alex   2010-12-15 19:37:27
Gravatar image hello i would like to use this method cause i need to display random images when timthumb doesnt find any image. So this is what i do:
Code:
if(empty($first_img)){ //Defines a default image
$first_img = "images/default.gif";


so i thought like do this, but it doesnt work:
Code:
if(empty($first_img)){ //Defines a default image
$first_img = "rotate.php";

i'm really not a php pro, so how u think i should implent this?
if i paste the full tags yes it works really good, so my problem is the "$first_img = "
bob1 - btn random img   2010-12-16 16:23:32
Gravatar image can we make a button that when we clik on it it will change the picture to an other random picture without reloading the page??
Dave - Blue Ive Aviation   2011-02-10 06:15:14
Gravatar image Hey Marco,

I've been looking for a clean script like this for a while now and just want to say a big thanks. Im not an expert and this little guy was up and running perfectly in under 5 minutes!

Just relaunched this site and was glad to get this last little icing on the cake just in time!

Thanks again!!

Dave
Dode   2011-02-22 09:16:57
Gravatar image Hello,

I'm totally new at this, but i have to change one website. It's php site, but i can only add pictures and text like in forum. So i downloaded your script ant put it in new folder with some images. Inserted script like picture and it's work. Show me all three pictures random, but sometimes it's show small and sometimes original size. I made fix dimension, so some pictures came ok and other like small ones stretched with very low resolution. Why this happens? there is only 3 normal dimension pictures in folder.

Sorry for my broken English, hope you understand something:-)
Dode   2011-02-22 09:21:28
Gravatar image Looks like found solution. Somehow there was created thumbs pictures with low resoliuton.
Dode - re:   2011-02-22 09:22:55
Gravatar image
Dode wrote:
Looks like found solution. Somehow there was created thumbs pictures with low resoliuton.
Dode wrote:
Hello,

I'm totally new at this, but i have to change one website. It's php site, but i can only add pictures and text like in forum. So i downloaded your script ant put it in new folder with some images. Inserted script like picture and it's work. Show me all three pictures random, but sometimes it's show small and sometimes original size. I made fix dimension, so some pictures came ok and other like small ones stretched with very low resolution. Why this happens? there is only 3 normal dimension pictures in folder.

Sorry for my broken English, hope you understand something:-)


Opps again they was created. Is there some way to avoid creating these small resoliution pictures? Or this is site makes them?
Jojo - Random Rotation with Duration   2011-04-01 18:00:40
Gravatar image Hello, I know this is already old but I need to ask this... is there a way to have the random images to be used as background with a 24hr duration? It's like having a different background image each day. That even the page is refreshed, it should show the same background image until next day when a new random image is shown.

Can this be done throughout the site and not just the home page? I mean for example a random image is loaded on the home page, the same image should be shown on other pages for 24hrs. I know it's a dumb question.
Anonymous - re:   2011-04-05 09:17:00
Gravatar image
Anonymous wrote:
hello
this is reza. I want to link images saved in a folders with other data from mysql....in a tabular projection....please help me with php code... May Allah bless u....thanks..

my email: humayon5232@yahoo.com

xcvxcv
xcv
xc :cheer: :cheer: :cheer: :cheer: :cheer: :cheer:
vxc
v
xcv :0 :0 :0 :0 :0
anotherdude - Won't work in dreamweaver   2011-04-07 09:19:05
Gravatar image Hi... im new to site building, im using dreamweaver cs5 and i inserted this link into the script and everything but it always shows a little question mark in a blue box when i try to live view it. i dunno what ive done wrong.

ive put it in a table

the script where i put it is


 
 


 
 
 






i also tryed on the other side of the   but no luck... im lost... an clues people of the internet?


thanks in advance
Christian - Won't work in dreamweaver   2012-05-31 15:02:55
Gravatar image Have you found a solution for this? I'm experiencing the same problem.
desmond22 - Google Chrome   2011-04-26 12:16:06
Gravatar image There is super extra padding under the image in Chrome. ie and FF are fine
khalid elmasry - auto refresh   2011-06-05 11:29:31
Gravatar image where to integrate the auto refresh code ?
hair loss cure treatment - hair loss cure treatment   2011-06-09 08:20:22
Gravatar image I really want to thank yahoo search engine who have sent me to this wonderful site. The articles posted on this site are great and amazing. I am glad that I have found this amazing site.
birth control pills dosage - birth control pills dosage   2011-06-09 08:21:22
Gravatar image I found this site extremely useful and informative. It is full of all useful stuff and I am glad that I have come across this site. I have made by job much easier, thanks for sharing with us.
secure weightlos toxics pills - secure weightlos toxics pills info   2011-06-09 08:22:12
Gravatar image Wonderful post. I like the way it is written and presented. I have book marked the site for my future reference.
online birth control pills rev - online birth control pills reviews   2011-06-09 08:23:41
Gravatar image Nice blog and the article are simply superb. The article posted was very informative and useful. You people are doing a great job. Keep going.
herbal hair removal loss - herbal hair removal loss   2011-06-09 08:24:40
Gravatar image I had logged onto this site very recently and found it to be very useful and informative. Each and every concept was well presented. Thanks a lot for the information.
pharmacy spot - pharmacy spot   2011-06-09 08:29:04
Gravatar image This was really a great site which I had found it to be very cordial and I really liked it very much. Thanks a lot.
online diabetes pills advisor - online diabetes pills advisor   2011-06-09 08:31:07
Gravatar image The information which I had found in this blog was really very cordial and I had liked it very much. Thanks a lot for the information.
online diabetes pills tips - online diabetes pills tips   2011-06-09 08:32:17
Gravatar image This site was really very interesting and I had got impressed with this stuff. Thanks a lot for the lovely information which was given in this blog.
best pharmacy journal - best pharmacy journal   2011-06-09 08:33:10
Gravatar image I had really enjoyed viewing this blog. The information was really very cordial and it was very helpful for me. Thanks a lot for the stuff.
online safe diet deals - online safe diet deals   2011-06-09 08:33:56
Gravatar image I am very glad to post a comment on your blog as I really enjoyed reading your posts.
balanced dietside effects jour - balanced dietside effects journal   2011-06-09 08:34:45
Gravatar image The information provided was extremely useful and informative. Thanks a lot for useful stuff.
secure weightloss pills review - secure weightloss pills reviews   2011-06-09 08:35:33
Gravatar image This article is so interesting I am completely engrossed. Really I appreciate the efforts you take for making these posts. Thanks for sharing with us such useful information.
online cheap pharmacy usa - online cheap pharmacy usa   2011-06-09 08:36:33
Gravatar image I really enjoy reading your well written articles. I think you spend numerous effort and time in posting the blog. I have bookmarked it and I am looking ahead to reading new articles. Keep up the good articles!
klassiadmin - klassifriends   2011-06-20 23:20:12
Gravatar image This script did exactly wat i wanted it to do for me with a small mod as i only wanted it to show on a single page. so that everytime the home page is loaded the background image changes.
Bhawin - Thanx...   2011-07-03 11:30:01
Gravatar image Hi,
I m Bhawin. my website is http://www.Jordar.com. I used this method and i m happy...

Nice Information of Image Rotation


It is very nice Effects in website..

And it is worked..

Thanx...
Mr.4x3 - Mr.4x3   2011-07-09 15:00:08
Gravatar image Really I appreciate the efforts you take for making these posts. Thanks for sharing with us such useful information.
Mr.4x3 - Mr.4x3   2011-07-09 15:01:43
Gravatar image I had found it to be very cordial and I really liked it very much
Sartaj Ahmed - Get Image dpi from php code   2011-07-19 05:57:39
Gravatar image Can any one tell me how can i get DPI of uploaded image.

Thanx
rajendra - Web Hosting Pad Review   2011-08-02 09:51:01
Gravatar image This is very great for the nice info in this blog and helpful info in this website. I really inspired for this info is providing in this blog. I am really very happy for providing the nice info in this blog and the using the nice info. I had really like it very much for helpful info in this blog. I am searching some info in this blog and the great services in this blog. Thank you very much for providing the nice info in this blog.
Ann - Creative Director   2011-08-17 17:44:39
Gravatar image Thanks, this works great for my images, but when I try to add a flash .swf file into the php it just gives me a ? here is the code line I've added for the swf:

$extList['swf'] = 'application/x-shockwave-flash';

Thanks
Joe   2011-08-18 01:57:52
Gravatar image Hello

I love this script, thanks for making it.

I have one issue though. I have a little panel on my website, that i want to have 3 random images showing in it. I have just linked to the script 3 times, but it shows the same 3 images. Is there a way i can make each one show a different image? Any help is appreciated
Jeff   2011-08-25 16:21:48
Gravatar image Awesome..
I want to use this as a background for the body of my page.

one questions tho..
1. I do not have a file manager option, all my images/files are in one folder. How do I use specific images?
Steven Salkow - Salkow Territory   2011-09-08 20:30:03
Gravatar image This is a really neat script and was easy to implment

I am using your PHP Random Image Rotation but the images did not seem to regularly span ALL the images

On line 186, I changed the random number generator to:
Was: $imageNumber = time() % count($fileList);
To: $imageNumber = rand(1, (count($fileList));

Which seems to correct the symptom. I don
abu - duiter   2011-09-12 02:12:26
Gravatar image pusing wis ora paham blas oe......
Jon   2011-09-15 15:45:46
Gravatar image Excellent little script!
immo   2011-09-27 19:05:44
Gravatar image Thank you for this script.
Others didn't work but this one did at the first try.
FidoX - Main page   2011-10-03 23:41:33
Gravatar image Hi! How can i put this script in the main page of my website?
Blogs On Blogger Directory - Blogs On Blogger Directory   2011-10-07 14:50:00
Gravatar image Was Already Using a Different image Rotator on My Site and this looks quite impressive, giving it a try.
Thanks for this.
Blogs On Blogger Directory - Blogs On Blogger Directory   2011-10-07 14:50:53
Gravatar image Was Already Using a Different Banner Rotator on My Site and this looks quite impressive, giving it a try.
Thanks.
Blogs On Blogger Directory   2011-10-07 14:52:10
Gravatar image Blogs On Blogger Directory
Blogs On Blogger Directory   2011-10-07 14:52:57
Gravatar image Thank you for this script.
Anonymous - ?   2011-10-23 05:15:15
Gravatar image I don't get it.
Different55 - Not-so-random image rotation   2011-11-09 11:14:02
Gravatar image I'm trying to make this so that it's not random, that it rotates every day or week or month. I'm not having much luck. Any help?
Lee Greaves   2012-03-30 03:35:59
Gravatar image Have u tried using the $SECOND function? you would have to work out how many seconds there are in a week or even a month (haha good luck with that!) but that could be the only way i think u cud do it
olo - great stuff   2011-11-12 23:32:38
Gravatar image Thanks a lot!
Scriptin Us - Great Script!   2011-11-29 23:53:52
Gravatar image Well, I'm using this on http://www.chansluts.com and http://www.tranchan.net. I've been using it for years (I can't even remember how long). The only issue with it (it does work perfectly) is that recently I noticed that the log file gave an error: mod_fcgid: stderr: PHP Notice: Undefined index: extension in /.../images/top.php on line 34

This is the only time I've seen it and I'm not sure if it really means anything.
John - image error   2011-11-30 20:18:29
Gravatar image I have placed the file in the dir that contains the images and used dreamweaver css rule to point at the rotate.php file but recieve the image error in the place of the image. This means the code is running but no image is being found since it is null. Any suggestions on trouble shooting?
john - image error   2011-11-30 20:48:04
Gravatar image I noticed that dreamweaver did not sync the image files with the wamp server, once sync'd, all is working fine, thanks.
Casper - Same issue   2012-01-08 04:05:55
Gravatar image I am getting the same problem you had; when I load the page through Dreamweaver it just gives me the missing photo icon. Will this change once I up all the folders to my host server or what do you mean my sync-ing?? I'm a bit of a noob and any help would be appreciated!
Dylan - dreamweaver   2012-02-15 15:34:08
Gravatar image how do you do the sync?
jc   2011-12-15 07:27:01
Gravatar image very VERY cool script. Thank you so much! - JC
olcay   2012-01-07 04:33:37
Gravatar image hi
i just downloade your script and i think it is really usefull but is there a way to show more then 1 pic
i mean i would like to show maybe 5 pic or more
would be great if you can help

thanks
JohnS - image rotation   2012-01-13 12:24:20
Gravatar image Hi, nice article. Actually I was looking for something like this image rotation: http://www.flashxml.net/product-viewer.html. It's possible to create something like that with PHP? Keep up the good work!
RogerG   2012-02-03 04:11:24
Gravatar image Does this work on angelfire.com? i've tried this code but for some reason its not working.
I've uploaded rotate file to angelfire and placed the code where i want the photo's to rotate but i get a blue box. help.
pissed off guy - waste of fucking time   2012-02-20 12:40:47
Gravatar image this shit doesnt fucking work for shit, what a waste of time
lol - picture   2012-03-22 07:42:10
Gravatar image hello,can i know how can select the picture using php code?
Lee Greaves - Adding timed rotation   2012-03-30 03:20:11
Gravatar image Is there any way I could add a "timed" rotation to the displayed images. Rather than have each image appear each time u (re)visit the page or hit your "refresh" button; is there a way I can have the images rotate every "n" seconds, such as 5 or 10 seconds. Im assuming the code would need to be slightly altered to allow this, perhaps using the $SECOND command.

Appreciate any pointers
bob s   2012-06-12 15:45:57
Gravatar image I am searching for same thing Lee. like way can randomly select photos, but want to change very 10 seconds. If us JS, have to label each image every time change to fits. trying to find a way to do it in PHP. See this question a lot, but no answers - starting to think it's not possible
Aidan - Fantastic   2012-04-15 18:11:33
Gravatar image Works perfectly, thanks for sharing your script!
Imrul - Need help for Wordpress   2012-04-25 05:57:45
Gravatar image I need this solution for wordpress.. how can i rotate header image after every time page refreshes ? please help
sarip.net - can you modified the script   2012-05-03 06:47:34
Gravatar image hi, can this script be modified - just to show text that randomly select from .txt file insted of img file, please help, thanks
Luis   2012-05-19 05:05:33
Gravatar image I couldn't get the script to work while testing my site before uploading to my server, I then realized it only worked when uploaded!

Thanks!
Erin - help?   2012-06-07 04:01:15
Gravatar image I'm kind of a php idiot. More of a graphics person really, but I'm (trying) to figure out how to make a banner with SEVERAL random php images. The only thing is I don't want repeats of the same image at the same time.

Here's how I have it set up currently:




Erin   2012-06-07 04:05:41
Gravatar image well.. that didn't work... lets try this again. Since it wont let me paste the code directly and I dunno how to fix it,

Basically I have it set up so that the image is pulled from a folder (with proper tags):

{img src= "images/random/image_{?php $random = rand(1,47); echo $random ?}.jpg"

this is then put into a table with several images. I chose this route because, as you can probably tell, coding isn't my forte and this was simple enough even for me. any advice?
Erin   2012-06-07 04:14:01
Gravatar image :pinch:

well I feel stupid. Nevermind, I just changed the numbers in the sequence. Facepalm...
Butch - Rotate based on file prefix?   2012-07-04 15:14:50
Gravatar image I'd like to set up this script to rotate thumbnail images from one of my Coppermine albums. Coppermine takes the original image then renames, resizes and copies to the same folder like this.

myimage.jpg
normal_myimage.jpg
orig_myimage.jpg
thumb_myimage.jpg

I'd like to use the thumb_ images outside of my Coppermine Gallery without using the others... Can the script be setup up to use images with only the thumb_ prefix?

Thanks
Adell - PHP random image rotation script for your website   2012-07-19 16:13:15
Gravatar image With havin so much content do you ever run into any issues of plagorism
or copyright violation? My blog has a lot of unique content I've either authored myself or outsourced but it appears a lot of it is popping it up all over the internet without my permission. Do you know any methods to help stop content from being ripped off? I'd truly appreciate it.
DougC - No Dice!   2012-08-05 05:58:17
Gravatar image The instructions are coming up short - I'm not new to web development and this script simply will not work!
Kai - Rettungshundestaffel BRK Günzburg   2012-08-22 05:37:23
Gravatar image I need help.

I use this great script at our page (SAR-dogs), to display our sponsors.

Now I want to link to the first sponsors page, when the first logo is displayed. And when the second sponsor-logo is displayed, i want the link to the page of the second sponsor etc.

How can I do this?
TadeX - Security   2012-08-30 14:15:57
Gravatar image Hi!

First of all your extension works great.

I´m not an expert of php, but there is not any risk by showing the path in the source code to the "remote.php" file? Could this be exploited in any way?
Mariana - PHP random image rotation script for your website   2012-09-12 17:49:51
Gravatar image I've been a graphic artist for more than 12 years now. So i'm somewhat a new comer to operating
a blog and noticed your blog while searching for design blog sites.
I must mention just how motivated I am with all your posts in addition to the general
high quality of your site. I'm hoping I can build up a site like your own and will think about your articles with great interest. Thanks a lot for the ideas friend.
Mike - previewing offline   2012-11-05 20:37:20
Gravatar image Great script just what I'm looking for for my revamped site. Is there a way to preview the script offline. I just get the dreaded redcross symbol when I try to view it offline even though I've pointed the img src line to the actual folder on my local drive.
eg.,


I've also tried it with http:// instead of J:/

Hope you can help
Ron - Finally something GREAT and SIMPLE   2012-11-07 21:54:32
Gravatar image Just wanted to thank you very very much for this excellent little script. I give me all I needed, just an image in the post(s) at random from a folder, which gives the easy way to have seperate folders for seperate rotations.

Any adjustments are simply done in the form of basic HTML in the post, before or in the call code.

Just sorry I wasted so much time finding a simple plugin to do it and non could do as I wanted.

Again thank you for making my day and my blog better yet simpler.
killday - Strange Problem   2012-11-19 20:26:54
Gravatar image I'm developing a page and using this script for background. The problem is that I'm working on two diffrent computers and so two diffrent wamp servers on the first one is working grade and on the second it does not work at all. ANY HELP!???
dcg - fdgfhgf   2012-12-06 11:45:34
Gravatar image :cheer: :evil: :P :woohoo: :whistle: :s :pinch: :D :(
Bob - Great Help   2012-12-20 13:11:45
Gravatar image Thanks for providing this PHP script. It is exactly what I have been looking for, and struggling to write. Thanks again.
eworm   2013-01-02 23:42:54
Gravatar image Simply amazing stuff, but as a couple of people above I find it's not entirelly flawless. Sometimes my pngs don't fully load and just stop halfway. Do you know any way to fix this? :dry:
Aaron   2013-02-05 16:09:39
Gravatar image hey, thanks for the script! Is there anyway to set this so its not random? I notice that a lot of the banners get shown over and over again...

...it would serve me much better if it just went it order:

link1 - load 1
link2 - load2
link3 - load 3

etc..

thanks!
alexb   2013-02-17 21:10:45
Gravatar image hey. script is great. except it doesn't work in chrome?? as in it works but the images stay the same unless you close the tab and open another and go back to website. if you browse through the website it stays the same.

try it: www.anystove.co.uk

thanx tho :)
alexb - re:   2013-02-17 21:14:30
Gravatar image oh actually maybe i didnt use your script :S
Skaty - ExpiresByType   2013-03-03 00:46:52
Gravatar image Hi, i'm using this script for a while thank you for that.

But now i'm doing this ExpiresByType for my web site. In this case rotate.php didn't work with that. Is there a way to make it work ?
AP   2013-03-13 21:47:43
Gravatar image Good day!

I implement this via a CSS class, then on my page I simply use:
Code:
 


In Chrome - the image would not refresh, although visiting the script directly proves it works in this browser.

My work around was to move that ONE class to its own CSS file, and then generate a value so that the browser always thought it was a new file to load.

my PHP example:
[code]
AP   2013-03-13 21:49:34
Gravatar image hmmm - code turned off? use $v=time() then append the $v variable to the end of your css
nate   2013-03-19 17:57:35
Gravatar image Any way to make it go in order and not so much random
any help would be good
onezzz - different alt tag for each image   2013-03-30 03:26:19
Gravatar image Hello Marco, thanks for the great script
is it possible to have different link, al,t and title tag for each image ?
Anonymous   2013-04-03 23:00:29
Gravatar image hay qua
hung - ghe tham   2013-04-03 23:01:32
Gravatar image hay qua ban ak thank nhjeu nhe
Max39 - if this rotate get me a 1.jpg i want this image ge   2013-04-09 09:10:43
Gravatar image if this rotate get me a 1.jpg i want this image get a specific href link.
how to do this?!
Twyla McKee - Web Designer needs advice   2013-04-13 20:42:50
Gravatar image Hi. I love the script you gave - it is definitely useful in so many ways. I am currently working on a website redesign for a client, and have run into a bit of a problem. I read through many of the comments and replies above, and found the issue mentioned in a few comments - the only reply from you was that it wasn't possible at the time, and that was back in '09. I know that HTML5 has come out since then, so thought I would pose this question again, with my thoughts on it. The client wants to have 2 rotating banners on each webpage. Each page is for a different state, city, or county, so the banners that rotate on each page are associated with the state/city/county the page displayed is for. The banner rotation is simple - place the rotate.php file in the folder with the images, place the script pointing to the file in the webpage for the source of the image place-holder. Since I am having him keep the banners for each area saved in separate folders per area, that makes it pretty simple. The issue is that he wants each image to link to a webpage for the company the banner is an ad for. I was thinking of trying something out, but not too sure how to get it set up - so want to run it by you and see if you can help me out with it or point me in the right direction.
SQL databases can be set up to save images or image locations in them - so you could have 2 parts to the image database: Image and Link. The new script would pull from the database, rather than a folder. This way, the information pulled on page load/refresh would pull both the image and the link data, which would be connected in the database. I'm not really good with the scripting to do this properly, so was hoping you might be able to help me figure it out. I know that the information pulled would need to be properly put in, and I am not comfortable with figuring out how to script it properly myself. The new rotate.php would need to point to the database, randomly pull 1 line of data from it, and fill the src() and href() in from that data. Can you help me figure out how to do this right, please? Thank you!
Danilo - PHP random image rotation script for your website   2013-04-26 17:20:04
Gravatar image Somebody essentially assist to make significantly posts I'd state. That is the very first time I frequented your web page and to this point? I amazed with the analysis you made to make this particular put up incredible. Fantastic process!
Mark - re: Web Designer needs advice   2013-04-26 23:19:40
Gravatar image Need help come visit us
Fysisoft - I need more stuff   2013-05-15 15:18:27
Gravatar image I am looking for some css or php code to show slide show as bg images
Honza - Thank you!!   2013-06-05 07:15:30
Gravatar image Thanks a lot!
Jay Montgomery - Rotate.php not rotating images in Safari   2013-06-07 03:46:21
Gravatar image Hello,

This is a great script! I worked for me for several months but now it's not changing the background images in Safari Version 6.0.4 (7536.29.13) on a Mac OS 10.7.

It loads the first background image then no matter how much a refresh the page the image does not change. Work on Chrome and Firefox. Check it here, it's set up for each of the pages on this site.

http://www.infinitymultimediaproductions.com

What could it be?

Thanks,
Jay
Read more...
Name:
Email:
  Gravatar enabled.
Website:
Title:
UBBCode:
[b] [i] [u] [url] [quote] [code] [img] 
 
 
:angry::0:confused::cheer:B):evil::silly::dry::lol::kiss::D:pinch:
:(:shock::X:side::):P:unsure::woohoo::huh::whistle:;):s
:!::?::idea::arrow:
 
Security Image
Please input the anti-spam code that you can read in the image.
Unsubscribe from e-mail notifications.
 
< Prev   Next >
Subscribe

Subscribe to Marcofolio