#!/usr/local/bin/perl

$imagedir = 'http://www.example.com/images/';
@arrimages = ("image1.gif", "image2.gif", "image3.gif");

$seedno = $#arrimages + 1;
srand(time ^ $$);
$imageid = rand($seedno);
print qq(Location: $imagedir$arrimages[$imageid]\n\n);
return;
Published in: CGI
Download

Related snippets