The following elements can make up the user-inputting portion of a form:
The sample image on the right shows all of these elements:
While client-side languages used in conjunction with forms are limited, they often can serve to do pre-validation of the form data and/or to prepare the form data to send to a server-side program.
Scripting languages are the most common server-side programs used for web sites, but it is also possible to run compiled programs.
Some of the scripting languages commonly used:
Some of the compiling languages commonly used:
A PHP script may:
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  for 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.
Perl is another language often used for web development. Perl scripts are traditionally used as Common Gateway Interface applications (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 server than using CGI (such as FastCGI or 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 PHP or ASP. This is especially true if Perl modules would need to be installed on the web host or 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 Safe module, wouldn't be very practical and undoubtly break a lot of scripts considering common practices. Similar considerations might apply to other general-purpose scripting languages like Python or Ruby. For these reasons, a lot of cheap web hosts nowadays effectively only support PHP and web developers often seek compatibility with them.
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 "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.