The community is working on translating this tutorial into Chinese, but it seems that no one has started the translation process for this article yet. If you can help us, then please click "More info".
If you are fluent in Chinese, then please help us - just point to any untranslated element (highlighted with a yellow left border - remember that images should have their titles translated as well!) inside the article and click the translation button to get started. Or have a look at the current translation status for the Chinese language.
If you see a translation that you think looks wrong, then please consult the original article to make sure and then use the vote button to let us know about it.
Please help us by translating the following metadata for the article/chapter, if they are not already translated.
If you are not satisfied with the translation of a specific metadata item, you may vote it down - when it reaches a certain negative threshold, it will be removed. Please only submit an altered translation of a metadata item if you have good reasons to do so!
Sending the Data
Until now we have not discussed how to actually send the data entered by the user. You can either send it to your email address, to another page, or to your database.
Whichever option you choose, you always have to define how the browser handles the user input. This is defined through the method attribute, which can have one of two values – post or get.
<form action="url-to-formmail-provided-by-your-ISP" method="post">
The get value ensures that the data is to be encoded by the browser into a url and post means that the data is sent to a database or your email. This means, that generally you will use the post value as it is used for form submissions.
The easiest way to handle your data is to send it to your email. All you have to do is add the action attribute to the form element and the method attribute. The action attribute tells the browser what to do with the content of your form and the method attribute tells the browser how to handle it. Here is an example:
<form action="mailto:email@example.com" method="post"> First name: <input type="text" name="firstname" /> Surname: <input type="text" name="surname" /> <input type="submit" value="Submit now" /> </form>
If you choose to use this method you need to be aware that the functionality depends on the email-client installed on your users’ computer. This means, that not all users will be able to use your form.
Otherwise you could use the formmail, which I mentioned earlier. When using a formmail, the value of the method attribute should always be post as you are sending the data.