By default it is a fairly simple format, but to send a binary object, a more complex one is required.
Using Php With Html Forms How To User HTMLThis article is a basic tutorial on how to user HTML Forms, the most common method of data collection.HTML Forms A common and simple way of gathering data is through HTML Forms.Forms are containers for user input and can contain any number of different input types.The HTML form element requires a few parameters to work properly: action: this should point to the page that is meant to process the collected data. As soon as the form is submitted, the browser is redirected to this location, along with all your data. A typical form element might look like this: Expand Select Wrap Line Numbers. As you may have guessed from the names of the two protocols, the GET and POST requests are designed for different purposes. The purspose of the GET protocol is to fetch and display data to the user. Simple key-value pairs can be passed via the query string, but they should ideally be used to specify what should be displayed on the page, rather than to push user data onto the server. It is designed to allow clients to send pretty much any amount of data to the server, in pretty much any format. This is what most forms should be using, and it is required for things like file uploads and to upload large amounts of text. Essentially, GET should be used for navigation and things of that nature, but POST should be used to send actual data. The GET protocol When using GET, the data from the form is encoded into the URL of the request. For example, if you were to submit this form: Expand Select Wrap Line Numbers. When you hit the submit button, the browser would redirect you to this URL: - action.phpUsernameJohnPassswordthePassword A very usefult aspect of the GET protocol is the fact that we do not have to use a form to submit GET data. Which means that the above data can also be submitted using the following HTML link: Expand Select Wrap Line Numbers Submit. This can be extremely usefuel in websites that show dynamically created content, such as forums or blogs, where you often need to create dynamic navigation links. The POST protocol The data submitted via the POST protocol is not visible in the URL. The data itself is put into the body of the request, which allows POST requests to upload more data, and more complex data, than the GET request. For example, to send a username and an image, you would use a form like this: Expand Select Wrap Line Numbers. You will notice there that an additional attribute has been added to the form. If it is missing, the files will not be sent. This attribute simply tells the client how to format the body of the request.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |