First, you need to process the form results that you'll receive once the user presses submit. A common way to do this is using the
CGI module. Read its documentation, and you'll learn how to get the value that the user entered into the "bantext" field. Then, you need to superimpose this value, this string, on a transparent gif file using a module that can modify graphics files. As other people have suggested, you can use for example
GD for that. Finally, you have to send back a response to the user that includes the generated gif file.