Results 1 to 3 of 3

Thread: Looking for a Banner Rotation Script without using SSI

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2000
    Posts
    64
    Anyone???

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    You may need to debug this a bit, but it's a start:
    Code:
    #!/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);
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  3. #3
    Hyperactive Member
    Join Date
    Mar 2000
    Posts
    292
    On the chance that you are looking for client side code, try this:
    http://www.builder.com/Programming/S...dt.bl_ss080700
    "People who think they know everything are a great annoyance to those of us who do."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width