Ok, thanks for the advice.  It makes sense how to do it now.  I adjusted the
code a bit and it is throwing errors.  My regex might be screwed up? (I'm
not very good with them)

Here's the code:

-----code-----

@images =
("meth.jpg","pennywise.jpg","power.gif","nightshade.swf","pckiller.swf");

srand(time() ^ ($$ + ($$ << 15)));
$plup = rand(@images);

print "Content-type: text/html\n\n";
if ($plup =~ m/(^\w\.gif\|^\w\.jpg)/ {
print "<img src=$plup>";
} else {
print "<emb src=$plup width="100" height="100">";
}

-----code-----

See anything wrong with the regex or any reason it's throwing a 500 error?




-----Original Message-----
From: Connie Chan [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 01, 2002 10:47 PM
To: Troy May; Beginners CGI List
Subject: Re: Random images on a bulletin board


Emm..... I don't exactly know what do you want,
but try this if that's what you want:

make an array to put your IMG files,
make another array to put your SWF files.

make a random 0, 1 to choose if you want to output
as IMG or SWF

if IMG, random a file from the IMG array,
if SWF, random a file from the SWF array,

if ($type = "img" ) { print "<img src=$imgfile width=......>" }
elsif ($type="swf") { print "<embed src=$swffile width=....>" }
## you may set width=100\% and height=100\%
else { print "Hi!" }

Hope this help,
Smiley Connie =)


----- Original Message -----
From: "Troy May" <[EMAIL PROTECTED]>
To: "Beginners CGI List" <[EMAIL PROTECTED]>
Sent: Tuesday, July 02, 2002 5:41 AM
Subject: Random images on a bulletin board


> Hello,
>
> I'm trying to make a random signature for use on bulletin boards.  Images
> are fine, they are set sizes.  But I'm trying to make it display Flash
files
> also.  These Flash files default to full-screen when there are no size
> limits set.  I can't figure out how to adjust this script to display
images
> AND Flash files.  Here's part of the script:
>
> ---------------
> $basedir = "http://www.mysite.com/sigs/";
>  @files =
>
("Night1.jpg","Night3.jpg","Nightshade5.jpg","Kimme2s.jpg","Amazsig.gif","Ni
> ghtshade1.jpg");
>
> srand(time ^ $$);
> $plup = rand(@files);
> print "Location: $basedir$files[$plup]\n\n";
> ---------------
>
> This works with just these images.  But these .swf files have to be
limited
> to 100x100 through HTML.
>
> Any ideas, or is this impossible?
>
> Troy
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.372 / Virus Database: 207 - Release Date: 6/20/2002


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to