Re: [PHP] Random Images with no duplicates?

2005-12-20 Thread Mike
"Mike" <[EMAIL PROTECTED]> wrote in message news:... I'd just like to thank everyone who helped me our with this. I think it's great that so many people would be so helpful and not expect anything in return. This list is quite a storehouse of info and I'm learning just from reading the posts s

Re: [PHP] Random Images with no duplicates?

2005-12-19 Thread Mike
I'd just like to thank everyone who helped me our with this. I think it's great that so many people would be so helpful and not expect anything in return. This list is quite a storehouse of info and I'm learning just from reading the posts since I joined last week! Again, thanks all. -Mike "

Re: [PHP] Random Images with no duplicates?

2005-12-18 Thread Silvio Porcellana [tradeOver]
Silvio Porcellana [tradeOver] wrote: > > > $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 ($ra

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 > > #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

RE: [PHP] Random Images with no duplicates?

2005-12-16 Thread Jared Williams
Hi, Just unset the ones you've picked "; unset($openFile[$r]); } ?> Jared -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] Random Images with no duplicates?

2005-12-16 Thread Kilbride, James
Guarentees unique 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:4

Re: [PHP] Random Images with no duplicates?

2005-12-15 Thread Curt Zirzow
On Thu, Dec 15, 2005 at 08:45:33PM -0800, Mike Rondeau wrote: > 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 ima

Re: [PHP] Random Images with no duplicates?

2005-12-15 Thread Aaron Koning
This should work, although if there are only 9 lines in the file, it will run infintely (or until the page times out)... so put a check in for that. $imagesNeeded = 10; $imageArr = array(); // Create array with $imagesNeeded number of elements. for($i=0;$i<$imagesNeeded;$i++) { // choose image

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 or something like that, someone is bound to show some mistakes in here but it works Kevin -- __

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 m

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: I have this code where I want the image to appear: HTH VW Quoting Tom Ray <[EMAIL PROTECTED]>: ### I'm trying to set it up so that a random image from either a mysql table ### o