How to create a mail form

How to create a mail form

Web forms were developed for data transmission from HTML document to the Web server. The user had an opportunity to change contents of Internet resources. It led to creation of forums, chats, guest books and other web applications.

Instruction

1. The web form represents a tag set of HTML which at their interpretation by the browser is displayed in the form of fields for information input. Each form surely has the button when clicking which all in-fed information goes to the server where it is processed by the special program. Data can be entered in base, are used at generation of pages of the website, sent by mail or used in any other way.

2. To send web forms to the server, there are two methods being used: GET and POST. The first has limited functionality (restriction for length of a line, impossibility of file transfer), and the second is more difficult in implementation. Both methods are integrated that on server side some program should accept data. But there is a way to obtain the data entered by the user into a form without programming. This technology received the name of ""mail forms"". The essence of a trick is that the browser sends a form not to a script located on the server, and to the mailbox specified in a form body where the form will come as the normal letter. The only minus of this method is the impossibility to send form contents if on the computer of the user it is not installed or the e-mail client is not configured. The number of users who do not use e-mail clients can be rather large.

3. For creation of a form open the text editor, write in it the standard heading HTML. In the section BODY of the document write a line: <FORM enctype='text/plain' action= 'mailto:This email address is being protected from spambots. You need JavaScript enabled to view it."">. The FORM tag opens a form, enctype defines type of contents which will be sent to a mailbox. This parameter does not need to be changed. The action field sets the place where data will be sent. The magic word mailto specifies to the browser that for sending it is necessary to use an e-mail client. Replace the line This email address is being protected from spambots. You need JavaScript enabled to view it. with the mailbox address where form contents will be sent.

4. Now it is necessary to add the field of a form. The next line describes a text box of input by the size in thirty characters: <INPUT name='name' type='text' value='vashe name' size= '30'>. The name parameter sets a form name. The value parameter contains the hint which will be seen by the user in the data entry field. Now it is necessary to create the button of sending a form: <INPUT type='submit' value='otpravit'>. When the user presses this button, contents of a form will be sent to the mailbox specified in form heading. Now it is necessary to close a form in the line </FORM>. Save the text file with the htm extension, open it in any browser. Enter something into a form and click ""Send"". Check a mailbox.

Author: «MirrorInfo» Dream Team


Print