View Single Post
Old 02-20-2003, 11:25 AM  
FuqALot
Confirmed User
 
Join Date: Dec 2001
Location: Malibu
Posts: 3,817
I posted this before on this board but here it is.

Hi... here's a simple code im just writing now.. so if you need help hit me up.

create a file named rotate.cgi or something and put it in a directory where you also have all the possible rotated .html galleries. (so like yourdomain.com/galleries/rotate.cgi)

put the following code in it:

#!/usr/bin/perl
$usrid = $ENV{'QUERY_STRING'};
print "Content-type:text/html\n\n";
@galleries = <*.html>;
$galleryfile = $galleries[int(rand(@galleries))];
open(gallery,$galleryfile);
@galindex = <gallery>;
close(gallery);
foreach $line (@galindex) {
$line =~ s/%revid%/$usrid/g;
print $line;
}

In your galleries, replace the REVID, with %revid%, so the script knows where to insert the users id.

Then let people visit like this:
http://www.yourdomain.com/galleries/rotate.cgi?XXXXXX

Now a random gallery will be picked and
the %revid% will be replaced with XXXXXX and gallery will be printed.

Just wrote it, but it's that easy that it should work. Heh.

Last edited by FuqALot; 02-20-2003 at 11:27 AM..
FuqALot is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote