Thread: random image
Results 1 to 4 of 4
Related
-
Random Image/Member/Forum topic Forum: PHP Forum
Replies: 1 -
Random Image Problem Forum: Javascript Forum
Replies: 3 -
Getting A Webpage to Load A Random Image (.swf) File Every Time It Loads Forum: Javascript Forum
Replies: 2 -
random sponsors Forum: HTML Forum
Replies: 1 -
Random Pic Javascript Forum: Javascript Forum
Replies: 1
-
04-16-2007, 09:31 PM #1
random image
Hi, i'm trying to display a set of random images on a web page useing perl. I have a folder containing about 100 pics and want to display 5 at a time in a row.... however i can not get the script to display different images (no repeats). all 5 pics are always identical.
On the web page I am posting:
Code:<img src = "/cgi/random.pl"> <img src = "/cgi/random.pl"> <img src = "/cgi/random.pl"> <img src = "/cgi/random.pl"> <img src = "/cgi/random.pl">
Code:#!/usr/bin/perl -w $MAX = 9; $SERVER = "moc.etisbewym.www//:ptth" $DIR = "/bannerimages"; $FILE = "banner"; $EXT = "jpg"; srand (time^$$); $index = int (rand ($MAX)); print "Location: $SERVER/$DIR/$FILE$index.$EXT\n\n"; exit (0);
Last edited by DeadMeatGF; 04-17-2007 at 06:34 AM. Reason: Added Code tags
-
10-15-2007, 01:06 AM #2
Re: random image
Post your full code if you can. Because that section WILL NOT print a random image. I know of a much much much shorter and better method. But I want to see your full code first, then I can help you with it (I also do the same thing on one of my websites)
-
10-15-2007, 01:09 AM #3
Re: random image
Sorry, I read your code properly lol, and I still want to see all the my staements etc, just I can't see how you get "banner", wheres your file opening code?
-
03-24-2008, 02:11 AM #4
Re: random image
XMassey, would you mind showing "shorter and better" method you mentioned? I for one would be grateful.
Cloudjiffy- PaaS for Developers
10-05-2020, 12:30 AM in Web Hosting Forum