Discuss: A Better Image Rotator
by Dan Benjamin
- Editorial Comments
2 Can Not get this picture rotating script to wotk at all!!!!
This is on the face of it an excellent idear to have a php script that can be included in a php file that rotates various images round each time you load up the page….
However I have tried to get it to work a number of times and failed completely.. the script uses an ini file and sometimes shows a jpg file I have on the server but somtimes fails to load a picture and instead just shows a tiny red cross and no image….
It is very disappointing that it appears not to work correctly I would like to accept e mail about this in an attempt to correct this.. but feel that there must be several things wrong, either with the format of the ini file or the rotator.php script or both…........ Help>>>>...???
posted at 02:11 pm on August 27, 2005 by Julian Bowler
3 works, but...
it’s extremely slow… been testing the script, watching the ‘activity viewer’ as it downloads the test-page, sometimes it loads fast, but most of the time the download of the page grinds to a halt when it starts downloading the rotator.php file
posted at 04:29 am on September 09, 2005 by niklas mortensen
4 work with txt files?
will it work with text not images?
posted at 12:01 pm on September 10, 2005 by beth mix
5 Only uses first image in ini file
This script will only use the first image listed in the .ini file. I tried messing around with rotation.php but nothing worked.
From what I can see, either the ini isnt working correctly, or the rand() command isnt working for some reason.
Can anyone help me here?
posted at 07:51 pm on September 13, 2005 by mike Z
6 how to fix it...
well i know whats breaking it, but not sure how to fix it ;-)
the problem is the .ini files. if you have an url with a querystring appended to it, the array that parses the ini trips over and everything explodes in a big flaming fireball.
please please mr benjamin can you implement querystring support?
posted at 02:46 am on September 28, 2005 by alex morris
7 that was quick
well, i fixed it. if your url has a querystring in it. wang some quotes around the ini entry.
eg;
url = “think.php?id=43&category=life”
thanks for great little script benjamin.
posted at 02:52 am on September 28, 2005 by alex morris
8 problems with sub-directories
I can get this to work, but I am having trouble with using it in sub-directories. Ideally, I want to be able to use this with some variables.
For example, I want to set a variable for the root directory so that the “rotator.php” can be accessed by going to to the root level ($root/rotator.php). However, when I try to do this, I get an error with the showimage() function (Fatal error: Call to undefined function: showimage() in …)
Any ideas of how to fix this?
posted at 01:27 am on September 29, 2005 by andrew maury
9 Adding intervals
Is there a way to rotate images on a certain interval using only PHP? or at least clean JS? I was thinking of implementing a session ID… but that requires session code on each page. Any suggestions?
posted at 05:11 pm on October 07, 2005 by frog brain
10 Several links
it is possible to create several links at different places from the loaded image ?
Any ideas of how to do this?
posted at 05:58 am on October 10, 2005 by flip flop
Got something to say?
Discuss this article. We reserve the right to delete flames, trolls, and wood nymphs.
Create a new account or sign in below if you’d like to leave a comment.
Subscribe to this article's comments: RSS (what’s this?)


1 Testing!
Here is a comment that I will post. <b>eat</b> a sandwich.
posted at 07:56 pm on August 15, 2005 by Jason Santa Maria