| 1.) Upload to your cgi directory, chmod 755. You
can call it either through your browser or using an include statement in
your SSI file. Your text file should be in the format(remember the pipe
between the link and the image location) :
http://www.yourdomain.com/link_location|location of
the corresponding image
http://www.yourdomain.com/link2_location|location of the corresponding
image2
#!/usr/local/bin/perl
print "Content-type: text/html\n\n";
$db = "location of text file...must be actual path ex.
/u/web/your_id/files/txtfile.txt";
open (FID, "<$db");
@contents =<FID>;
$numRecords = scalar(@contents);
$index =int(rand($numRecords + 1));
$line = $contents[$index];
($html,$image)=split/\|/,$line;
print qq~
<img src="<a href="$html"><img
src="$image" border="0"></a>
~;
exit;
|