Server Push Animation

Last Updated: January 20, 2000


A very nice way to present information to clients is by providing an animation or slide show. This is done by using what is known as "server push". Server push is a type of dynamic document that is only compatible with Netscape Navigator version 1.1+. A simple CGI and a <img src=""> HTML tag can be configured to implement server push. The HTML and CGI source are presented in three sections below.

  1. The HTML source for server push
  2. The source code for server push
  3. Installation instructions


The HTML Source for Server Push

The HTML source below represents how server push can be implemented. The pathname and arguments (shown in bold) are explained in detail in the installation instructions section below.


  <img src = "/cgi-bin/push.cgi/pathname?arguments">


The Source Code for the Server Push CGI

The source code that handles the server push is based on the doit.c code that was written by Rob McCool, released to the public domain.

If you are unfamiliar with the CGI standard, or would like to learn more about the Common Gateway Interface, the following URL is an excellent resource:

http://hoohoo.ncsa.uiuc.edu/cgi/


How to Install the Server Push CGI

To install the server push CGI on your Virtual Server you will need to do two things:

  1. Download and compile the Server Push CGI source code
    You will need the server push source code file: push.c. Put this file in your "usr/local/etc/httpd/cgi-bin" directory. Make "usr/local/etc/httpd/cgi-bin" your current directory and then compile the executable "push.cgi" by issuing the following command:
      cc push.c -o push.cgi
    
  2. Configure the <img src=""> tag
    To configure the server push img tag, please refer to the comments included from the push.c source code.
     
      Example of how to use "push.cgi" to push 8 images located in a directory
      (which in this example is "usr/local/etc/httpd/htdocs/cgi/library/serverpush")-
     
      image0.gif     image1.gif     image2.gif     image3.gif
      image4.gif     image5.gif     image6.gif     image7.gif
     
      <img src="/cgi-bin/push.cgi/usr/local/etc/httpd/htdocs/graphics?base=image&lastframe=7">
                |---------------||----------------------------------| |--------| |----------|
                  path to cgi       path to images that are pushed     basename   last frame
                  executable                                           of images
     
      Other options include:  
      firstframe, delay, reverse, numloops, imagetype
    
      By default-
        firstframe will be "0"
        the delay will be "0"
        reverse will be "0" (FALSE)
        numloops will be "1"
        imagetype will be "gif"
     
      So, if the you had 8 jpeg's in the same directory (as the example above)
      and want to cycle 1-8 then 8-1 and also to do it twice.  I could use the
      following cgi call as the "src":
     
      "/cgi-bin/push.cgi/usr/local/etc/httpd/htdocs/cgi/library/serverpush?base=image&lastframe=7&reverse=1&numloops=2&imagetype=jpeg"
    
      Please note that name/value arguments are separated by an ampersand "&",
      and that no spaces (or carriage returns) are present.
     
    

Once you have completed the installation successfully, you will have a working server push animation.


Copyright © 1996, Last Modified: 20 January 2000.A Little Technology Shoppe, LLC. All rights reserved. All brand names and product names used on these web pages are trademarks, or trade names of their respective holders.