Not yet registered? Create a OverBlog!

Create my blog

Code for an HTML email form

In many cases, it can be useful to receive feedback from our web visitors. Common PHP or CGI applications can process data and produce edited reporting. However, in most cases, just a plain email is enough. HTML provides an easy way to send web forms data through this channel.

Generic form tags

Of course, first step is to define the input form itself. We will add the form part inside the body section of the HTML file: -FORM tag: needs opening and closing, it includes two attributes: ACTION: will define the URL for the data-processing file (PHP or CGI, for example). METHOD: Either "Get" or "Post"; email action will require usually POST method. - INPUT tag: To define each individual data entry. It includes two attributes, too: TYPE: it can be "text", "password", "radio" (button), "checkbox", "file", "submit", "reset"
NAME: an identification for later reporting and data management. - SELECT tag: for multiple choice selection (drop-down lists) - TEXTAREA: for special uses, where long input from the visitor is expected (comments, suggestions). Size can be defined in rows and columns.

Mail action

The action of sending the email will be defined at the URL position. Instead of "http://www.myweb.com/process.cgi", the action tag will include something like "mailto:myname@myweb.com". The "post" parameter will include the data pairs (data name and value) in a text file, which will be the email contents. If you are skilled with PHP, you might add some programming, so that output is formatted. If you just want to send raw data, this is not needed (although basic PHP may improve usability) to produce mail forms.

Example

The following example would define a basic structure for data input from the web visitor: FORM action="mailto:myname@myweb.com method="post"
INPUT type="text" name="visitor_name"
INPUT type="password" name="thepass"
SELECT name="gender"
OPTION value="male"
OPTION value="female"
TEXTAREA name="feedback"
SUBMIT form
RESET form
FORM end Please check the images included in this article for "real" HTML code view. To create forms with specific layout and styling, some more HTML or CSS is required; web forms can be real simple - or as complicated as desired. IMPORTANT If you include a "file" input (to upload a CV, or maybe some cooking recipes) you have to include some filtering (even virus scan) to avoid the reception of malware - or just invalid data.

Same category articles Computers

How to select a computer vacuum cleaner

How to select a computer vacuum cleaner

More and more of us are spending more and more time in front of a computer, be it at work or at home. in our increasingly busy lives, we sometimes don't even have time to go and have a proper lunch or do much else. obviously, with this in mind, your computer will pick up a fair amount of dirt and grime. this article will help you to select a computer vacuum cleaner to suit your needs.
How do I clean up my computer?

How do i clean up my computer?

Cleaning a computer from time to time is essential if you want your computer to run efficiently and without problems. similarly, if your computer has encountered problems, then cleaning it may fix the problems. there are several steps which must be undertaken to keep a computer running smoothly. this article outlines the different clean-up tools which are required to clean up your computer.
Buying guide: Computer projectors for the home

Buying guide: computer projectors for the home

This particular article is dwelling on computer projectors for the home. it is also acting as a guide to prospective novice buyers. it further elaborates on some of the key features that are necessary with any projector system. the article has mainly deliberated on projectors resolutions and how they are likely to affect the buyer’s usage experience.
A guide to securing a wireless network

A guide to securing a wireless network

The growing popularity and availability of wireless access to the internet has made having secure networks more important than ever before and yet conversely, because of the plug and play type set-up of wi-fi networks, wi-fi security is often overlooked. below is a guide to some of the security options available.