[thelist] php image rotation problem

Bruce Gilbert webguync at gmail.com
Mon Mar 14 16:02:51 CST 2005


I am using the following php image rotation script.

<?php 
#random images example
#this is your file
$file = "rotating-images.txt";
#open the file
$fp = file($file); 
#generate a random number
srand((double)microtime()*1000000); 
#get one of the entries in the file
$random_image = $fp[array_rand($fp)]; 
#display the entry
echo "<img src='$random_image'></img>"; 
?> 


in my rotating-images.txt file I have my list of images named
image1.jpg, image2.jpg through image7.jpg all on a separate line.

the problem I am having Is a get a blank broken image every third or
so rotation and I can't debug to see which image is not displaying,
because I am calling it through <?php acquire and right
clicking/properties doesn't tell me anything.

all the images are on the server, and in the same file as the
rotating-images.txt

any ideas to what may be going on?
-- 
::Bruce::


More information about the thelist mailing list