Home arrow HTML arrow Page 4 - Submitting a Form Using an Image Tag
HTML

Submitting a Form Using an Image Tag


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.

Author Info:
By: Chris Root
Rating: 5 stars5 stars5 stars5 stars5 stars / 25
April 18, 2005
TABLE OF CONTENTS:
  1. · Submitting a Form Using an Image Tag
  2. · Submitting a Form
  3. · Processing the Form
  4. · The Server Side Code
  5. · GD Methods
  6. · Handling the Name
  7. · The TextBox Class
  8. · From the Top

print this article
SEARCH DEVARTICLES

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.


blog comments powered by Disqus
HTML ARTICLES

- Does HTML5 Need a Main Element?
- Revisiting the HTML5 vs. Native Debate
- HTML5: Not for Phone Apps?
- HTML5 or Native?
- Job Hunting? Freelancer.com Lists This Quart...
- HTML5 in the News
- Report: HTML5 Mobile Performance Lags
- The Top HTML5 Audio Players
- Top HTML5 Video Tutorials
- HTML5: Reasons to Learn and Use It
- More of the Top Tutorials for HTML5 Forms
- MobileAppWizard Releases HTML5 App Builder
- HTML5 Boilerplate: Working with jQuery and M...
- HTML5 Boilerplate Introduction
- New API Platform for HTML5

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials