- Form (web)
A webform on a
web pageallows a user to enter data that is, typically, sent to a server for processing and to mimic the usage of paper forms.Forms can be used to submit data to save on a server (e.g., ordering a product) or can be used to retrieve data (e.g., searching on a search engine).
A form in
XHTMLor HTMLis by far the most common way to use a form online.
The following elements can make up the user-inputting portion of a form:
* input field
** text – a simple
text boxthat allows input of a "single" line of text
** checkbox – a
** radio – a
** file – a
file selectcontrol for uploading a file
** reset – a
reset buttonthat, when activated, tells the browser to restore the values to their initial values.
** submit – a button that tells the browser to take action on the form (typically to send it to a server)
* textarea – much like the text input field except a textarea allows for multiple rows of data to be shown and entered
* select – a
drop-down listthat displays a list of items a user can select from
The sample image on the right shows all of these elements:
text boxasking for your name
* a pair of
radio buttons asking you to pick your sex
* a select box giving you a list of eye colors to choose from
* a pair of
check boxes to click on if they apply to you
* a text area to describe your athletic ability
* a submit button to send it to the server
These basic elements provide most possible
Combined with programs
Forms can be combined with various
scripting languages to allow developers to create dynamic web sites.This includes both client-side and/or server-side languages.
While client-side languages used in conjunction with forms are limited, they often can serve to do pre-
validationof the form data and/or to prepare the form data to send to a server-side program.
Server-side programs can do a vast assortment of tasks to create dynamic web sites — from authenticating a
loginthrough, for example, Lightweight Directory Access Protocolto retrieving and storing data in a databaseto spell checking to sending web server's Common Gateway Interfaceto execute the program to actually perform the tasks.
The advantage of server-side over client-side is the concentration of functionality onto one computer (the server) instead of relying on each
PHPis one very common language used for server-side languages and is one of the few languages created specifically for server-side programs.
A PHP script may:
* display the information on another page (ex: asking for a user's name and then displaying it on the web page)
* act as a logon interface
* post the data to a database (ex:
mySQL, an ASCIIfile, etc.)
* store the information on the viewer's computer in an
* generate an
The HTML form learns where to pass the data from the "action" attribute of the form's
HTML element. The target PHP file then retrieves the data either through POST or GET (see HTTPfor more information), depending on the programmer's preference. Here is a basic form handler PHP script that will post the form's contents, in this case "user", to the page using GET:
In the above script the $_GET [
"] and $_POST [ "] commands need to be changed, depending on what is used in the form, however $_REQUEST [ "] is used for both so it is more efficient to use for form collection.
Perlis another language often used for web development. Perl scripts are traditionally used as Common Gateway Interfaceapplications (CGIs). In fact, Perl is such a common way to write CGIs that the two are often confused. CGIs may be written in other languages than Perl (compatibility with multiple languages is a design goal of the CGI protocol) and there are other ways to make Perl scripts interoperate with a web serverthan using CGI (such as FastCGIor Apache's mod perl).
Perl CGIs were once a very common way to write
web applications. But not being specifically designed for web development, Perl is now often viewed as less practical (both for developers and users) than specialized languages like PHPor ASPFact|date=March 2008. This is especially true if Perl modules would need to be installed on the web hostor if wanting to use a non-CGI environment that might require extra configurations on the web server. Some web hosts also rely on interpreter-level sandboxing, which while possible with the [http://perldoc.perl.org/Safe.html Safe module] , wouldn't be very practical and undoubtly break a lot of scripts considering common practices.Fact|date=March 2008 Similar considerations might apply to other general-purpose scripting languages like Python or Ruby.Fact|date=March 2008 For these reasons, a lot of cheap web hosts nowadays effectively only support PHP and web developers often seek compatibility with them.Fact|date=March 2008
A modern Perl 5 CGI using the standard CGI module with a form similar to the one above might look like:
Among the simplest and most commonly needed types of server-side script is that which simply emails the contents of a submitted form. This kind of script is frequently exploited by
spammers, however, and many of the most popular form-to-email scripts in use are vulnerable to be hijacked for spamming purposes. One of the most popular scripts of this type was [http://www.scriptarchive.com/formmail.html "FormMail.pl"] made by Matt's Script Archive. Today, no version of this still frequently used script is considered secure.
To avoid the confusion and difficulty of installing and using scripts, webmasters often use a free forms processing service to get their forms working.
* [http://www.w3.org/TR/html4/interact/forms.html Forms in HTML documents] , the
W3C's spec page for forms in HTML 4.
Wikimedia Foundation. 2010.
Look at other dictionaries:
Form — may mean: *Form, the shape, appearance, or configuration, of an object *Form (furniture), a long seat or bench without a back *Form (education), a class, set or group of students *Form, a shallow depression or flattened nest of grass used by a… … Wikipedia
Form (document) — A form is a document with spaces (fields) in which to write or select, for a series of documents with similar contents. The documents usually have the printed parts in common, possibly except for a serial number. Advantages of forms include: *one … Wikipedia
Form (programming) — In component based programming (Visual Basic, .NET WinForms, and Delphi), a form is an easy way to create a GUI window. A form contains components and controls, which are a high level representation of standard GUI widgets; it s easier to… … Wikipedia
Web fiction — is written work of literature available primarily or solely on the Internet. A common type of web fiction is the webserial. The term comes from old serial stories that were once published regularly in newspapers and magazines. They are also… … Wikipedia
Web Cartoonists' Choice Awards — First awarded 2001 Last awarded 2008 Official website http://www.ccawards.com/ The Web Cartoonists Choice Awards (WCCA) are annual awards in which online cartoonists nominate and select outstanding webcomics. The aw … Wikipedia
Web Bot — Web Bot, or the Web Bot Project, refers to an Internet bot software program that is claimed to be able to predict future events by tracking keywords entered on the Internet. It was created in 1997, originally to predict stock market trends.… … Wikipedia
Web Callback — is a technology where a person can enter his or her telephone number in a form on a web site. The company who owns that web site will then receive the Web Callback request and a call center agent will call the person who made the request back on… … Wikipedia
Form based authentication — is presently (i.e. early in the 21st century) employed as a term of art in the context of Web and Internet based online networked computer systems. In general, it refers to the notion of a user being presented with an editable form to fill in and … Wikipedia
Web mapping — is the process of designing, implementing, generating and delivering maps on the World Wide Web and its product. While web mapping primarily deals with technological issues, web cartography additionally studies theoretic aspects: the use of web… … Wikipedia
Web traffic — is the amount of data sent and received by visitors to a web site. It is a large portion of Internet traffic. This is determined by the number of visitors and the number of pages they visit. Sites monitor the incoming and outgoing traffic to see… … Wikipedia