Re: [PHP] Random Images with no duplicates?

2005-12-20 Thread Mike
#random images example #this is your file $file = images.txt; #open the file $openFile = file($file); #generate a random number srand((double)microtime()*100); #get one of the entries in the file $random_image = $openFile[array_rand($openFile)]; #display the entry echo img src

Re: [PHP] Random Images with no duplicates?

2005-12-19 Thread Mike
with PHP, but am working to fix that. I've searched high and low for an answer to this question and so far no solution has presented itself. I have a script to populate my web page with random images: ?php #random images example #this is your file $file = images.txt; #open

Re: [PHP] Random Images with no duplicates?

2005-12-18 Thread Silvio Porcellana [tradeOver]
Jared Williams wrote: Hi, Just unset the ones you've picked ?php #random images example #this is your file $file = images.txt; #open the file $openFile = file($file); #generate a random number srand((double)microtime()*100); #get one of the entries in the file for ($i = 0

Re: [PHP] Random Images with no duplicates?

2005-12-18 Thread Silvio Porcellana [tradeOver]
Silvio Porcellana [tradeOver] wrote: code $file = images.txt; $openFile = file($file); $num_images = 10; # don't need this is PHP 4.2.0 srand((float) microtime() * 1000); $random_keys = array_rand($openFile, $num_images); foreach

RE: [PHP] Random Images with no duplicates?

2005-12-16 Thread Kilbride, James
choices. -Original Message- From: Curt Zirzow [mailto:[EMAIL PROTECTED] Sent: Friday, December 16, 2005 2:47 AM To: php-general@lists.php.net Subject: Re: [PHP] Random Images with no duplicates? On Thu, Dec 15, 2005 at 08:45:33PM -0800, Mike Rondeau wrote: Hi, I'm still very

RE: [PHP] Random Images with no duplicates?

2005-12-16 Thread Jared Williams
Hi, Just unset the ones you've picked ?php #random images example #this is your file $file = images.txt; #open the file $openFile = file($file); #generate a random number srand((double)microtime()*100); #get one of the entries in the file for ($i = 0; $i 10; ++$i) { $r

[PHP] Random Images with no duplicates?

2005-12-15 Thread Mike Rondeau
Hi, I'm still very green with PHP, but am working to fix that. I've searched high and low for an answer to this question and so far no solution has presented itself. I have a script to populate my web page with random images: ?php #random images example #this is your file $file = images.txt

[PHP] Random Images with no duplicates?

2005-12-15 Thread Mike
Hi, I'm still very green with PHP, but am working to fix that. I've searched high and low for an answer to this question and so far no solution has presented itself. I have a script to populate my web page with random images: ?php #random images example #this is your file $file = images.txt

Re: [PHP] Random Images with no duplicates?

2005-12-15 Thread Aaron Koning
presented itself. I have a script to populate my web page with random images: ?php #random images example #this is your file $file = images.txt; #open the file $openFile = file($file); #generate a random number srand((double)microtime()*100); #get one of the entries in the file

Re: [PHP] Random Images with no duplicates?

2005-12-15 Thread Curt Zirzow
: ?php #random images example #this is your file $file = images.txt; #open the file $openFile = file($file); #generate a random number srand((double)microtime()*100); #get one of the entries in the file $random_image = $openFile[array_rand($openFile)]; #display the entry echo img src

[PHP] Random Images

2003-02-05 Thread Tom Ray
I'm trying to set it up so that a random image from either a mysql table or a text file list is displayed on a page each time a user goes to it. I'm a little stumped as to how to do this with phpany suggestions? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] Random Images

2003-02-05 Thread V Dub
Tom! Here's one way: I named all of the images to display 1.jpg - 7.jpg This code is at the top of the page: ?$jpg = rand(1,7);? I have this code where I want the image to appear: img src=img/?print $jpg;?.jpg width=632 height=422 HTH VW Quoting Tom Ray [EMAIL PROTECTED]: ### I'm trying

RE: [PHP] Random Images

2003-02-05 Thread John W. Holmes
I'm trying to set it up so that a random image from either a mysql table or a text file list is displayed on a page each time a user goes to it. I'm a little stumped as to how to do this with phpany suggestions? What do you have so far? ---John W. Holmes... PHP Architect - A monthly

Re: [PHP] Random Images

2003-02-05 Thread Kevin Waterson
This one time, at band camp, V Dub [EMAIL PROTECTED] wrote: Tom! Here's one way: or you could do something like this... Simply set the image directory and fire it up ?php // just so we know it is broken error_reporting(E_ALL); // set the images directory $imgDir = './images';

[PHP] random images fom db

2001-11-16 Thread Joe Van Meer
Hi there. I have s a php page that randomly grabs an image's path from a db field and displays it on my php page. My problem is that sometimes when I refresh the image won't display. So I guess you can say I'm getting intermittent images...sometimes it displays and sometimes not. I've checked all