There are a number of ways to make the forms on your website more user friendly. This article will explain one way of doing this, which eliminates a page reload and replaces it with an image generated on the server.
Submitting a Form Using an Image Tag - The Server Side Code (Page 4 of 8 )
Our example will use PHP, but as mentioned before, there are many server platforms able to generate graphics. The basic idea will be the same.
In PHP, there are several options for generating graphics. The GD library is the most popular, and is built into most PHP distributions. Solutions based on the Image Magic and Freeimage libraries are also available. In this example we will be using GD.
The goal here is to provide a friendly notice that the user's entry to the contest has been processed. Unfortunately, assembling a complete image programmatically is not fun and doesn't always give the best results.
Fortunately, GD allows us to layer text on top of an existing image. All that is needed is to produce an image that is the same size as the image initially loaded in the page by using a graphics application.
Most people like to see their name on things, so the best course of action for this project is to create a graphic that has space for the name from the form.
One limitation that GD has for which we need a work around is that there is currently no way to center or right align text. The major portion of the server side code in this project is intended to adjust display of the text programmatically rather than through the existing API.