PDA

View Full Version : Random Picture



maverick
12-11-2004, 04:17 AM
Hi,
Well Im Looking For A Script That Gives Out A Random Picture Every Ammount Of Time ( 24 hours ).I Have Seen Does Scripts Of Random Picture Everytime You Refresh But Its Not Exactly What i Want.I Wanted A Script That Randomly Selects A Picture Out Of A Folder And Not One That U Have To Give Every Pictures Url( Since i want to have around 500+ pictures and cant give a link to each one :P) Well thanks for your time :)

cr3ative
12-11-2004, 09:30 AM
I think that for all scripts, you have to specify the photos required... it's unfortunate and time consuming, but it has to be done.

I'll have a quick look around for a script like you want though, and report back if I find anything.

Merry Christmas
cr3ative

GavinPearce
12-11-2004, 01:01 PM
If using JavaScript then you'd have to specify all the images required as it doesn't have the permissions to scan photos in a directory.

What you could do is name each picture 1.jpg through to 500.jpg and then have the JavaScript pick a random number, add .jpg and call up the image.

But if you use PHP or Perl, they can both scan a directory for the photos in it, and pick one at random, no matter what the file names are.

You may find this link helpful:
http://hotscripts.com/PHP/Scripts_and_Programs/Randomizing/Random_Images/index.html

TheDanWD
02-28-2006, 12:13 AM
Hi. I'm looking for a similar code. I have a code that makes the images random, which is good, but now, i want them to link to pages. The randomized images are banners to friends of our sites, and i want them to link to their respective websites. Can anyone help me out here?

Xiong Chiamiov
03-02-2006, 06:45 AM
Sounds like a job for sql to me, but I don't know that much.