in reply to Printing Random Image in HTML
if(!open DAT, "ads.dat") { print "Error: cannot open data file!\n"; exit 1; } else { @imgdata=<DAT>; foreach $c (@imgdata) { ($id,$image,$url,$type)=split(/\|/,$c); if ($type=~/^(internal|partner)$/) { push (@imgs, $image); } } $img = $imgs[int(rand($#imgs+1))]; print "Location: $img\n\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(Ovid) RE2): Printing Random Image in HTML
by Ovid (Cardinal) on Sep 13, 2000 at 20:32 UTC | |
|
RE: Re: Printing Random Image in HTML
by damian (Beadle) on Sep 14, 2000 at 06:20 UTC |