I can't use any php image rotators to show different random images in my pages. Every time the script is called it always brings back the same picture instead of a different picture. There are plenty image files so it's no coincidence. If anyone has an idea of how to make sure it will give me new randoms each time that would be very helpful.
I am using this as an image rotator:
http://automaticlabs.com/products/rotator
It basically gets a list of files, makes an array count to find out how many they are, and then does rand(0,count($fileList)) to get the image to pull when the script runs.
I've very simply used this like so, 3 times in one html file.
<img src="/rotator.php" />
<img src="/rotator.php" />
<img src="/rotator.php" />
I also tried using it in CSS:
#header {
width:860px;
height:120px;
background: #C6BB9D;
background-image: url("http://www.mysite.com/rotator.php");
background-repeat: repeat-x;
background-position: bottom;
}
The image still never changes. In the CSS I can somewhat guess that it simply only calls that image once and holds the information, but in the HTML it should call the image over and over again for each incarnation.
Using Image Rotator multiple times doesn't change picture
Moderator: General Moderators
have you tried 
Code: Select all
print_r($filelist)Code: Select all
$url = "/rotate.php?id=".substr( md5( $time().rand(1,100) ), 0, 8 );http://www.php.net/uniqid
md5(uniqid(0)), or instead of defeating the cache you could output the image into the src tag directly from within your script
md5(uniqid(0)), or instead of defeating the cache you could output the image into the src tag directly from within your script
Code: Select all
<img src="images/rotator/<? echo rand(0,count($filelist) ?>.jpg" />Prime example of an error in coding that could result in disaster if register globals was onTodd_Z wrote:Code: Select all
$url = "/rotate.php?id=".substr( md5( $time().rand(1,100) ), 0, 8 );
well, maybe not "disaster"