At what stage is the gif supposed to be created? For example, does someone type text into the bantext field, then press submit, you process the result via cgi, and echo back the gif? Is the gif supposed to be created and sent to the user at the same time as the form? Who generates the html? You'll have to talk us through the scenario in a bit more detail.