Hashemian Blog
Web, Finance, Technology

HTML Forms, Part 2

    📂 Computers,Web         🗨 No Comments

Click here to read Part 1

There are really many steps that a browser goes through to display a web page or post some data to it. For the purposes of this discussion, a simplified process consists of a request and a response. The browser makes a request to a server for a particular page, and the server returns the data to the browser in the form of a response.

There are a few types of requests a browser can issue using commands that are generally known as 'verbs'. The most widely used verb is GET. Whenever you visit a web page, your browser issues a GET command to the server along with some other parameters and the server obliges by returning the data for the particular page.

In fact you are reading this very page because your browser made a GET request to www.hashemian.com and specified this page. The server then returned this page to your browser in a raw format. Your browser then rendered it as you see now.

But what happens when you submit a form to a page? In that case the page generally contains a FORM tag like this:

<form method="POST" action="some_page">
some form elements such as <INPUT> here
a submit <BUTTON> here
</form>

Notice the POST verb specified as an attribute of the form tag. When you click on the Submit button, the data you entered on the form is sent to some_page using the POST verb. The POST verb is similar to the GET verb but there are some additional data. The browser contacts some_page, issues the POST command, it also specifies Content-Length and Content-Type.

Content-Length is the character length of the data that you have submitted to the page, while Content-Type specifies the format of the data. The data format, known as MIME type, is generally specified as application/x-www-form-urlencoded. That signals to the server that data was encoded in a specific format so the server can figure out how to decrypt and use the data. We'll delve into more details on POST in part 3.
,,,,

Your Comment

 

* Comments are subject to screening and manual approval.

Read Financial Markets  |   Home  |   Web Tools  |   Blog  |   News  |   Articles  |   FAQ  |   About  |   Privacy  |   Contact
Give a few Sats: 1GfrF49zFWfn7qHtgFxgLMihgdnVzhE361
paypal.me/rhashemian
© 2001-2024 Robert Hashemian   Powered by Hashemian.com