PDA

Click to See Complete Forum and Search --> : Looking for a Banner Rotation Script without using SSI


Wrestlecar Webmaster
Aug 26th, 2000, 05:21 PM
Anyone???

parksie
Aug 26th, 2000, 05:56 PM
You may need to debug this a bit, but it's a start:

#!/perl/5.6.0/bin/MSWin32-x86/perl.exe

# The file will be:
#
# --snip--
# ad1.gif
# ad2.gif
# ad3.gif
# --snip--
# etc...

open(FD, "settingsfile.dat");
@data = <FD>;
close(FD);

print "Content-type: image/gif\n";
chomp($data[0]);
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$filesize,$atime,$mtime,$ctime,$blksize,$blocks) = stat($data[0]);
print "Content-length: $filesize\n\n";

binmode STDOUT;

open(FD, $data[0]);
read(FD, $file, $filesize);
close(FD);

$data[0] = $data[0] . "\n";

print $file;

open(FD, ">settingsfile.dat");
for($i = 1; $i <= $#data+1; $i++) {
print FD $data[$i];
}
print FD $data[0]; # put just-done item to end
close(FD);

noone
Aug 26th, 2000, 10:14 PM
On the chance that you are looking for client side code, try this:
http://www.builder.com/Programming/Scripter/080700/?tag=st.bl.3882.edt.bl_ss080700