Domain and web hosting - 122Part IPHP: The BasicsThe GETmethod of form handling
122Part IPHP: The BasicsThe GETmethod of form handling offers one big advantage over the POSTmethod: It con- structs an actual new and differentiable URL query string. Users can now bookmark this page(and thus find the oh-so-necessary encouraging word when their team starts to fade in thedoldrums of August). The result of forms using the POSTmethod is not bookmarkable. Just because you canachieve the desired functionality with GETarguments doesn t mean youshould. The disadvantages of GETfor most types of form handling are so substantial that theoriginal HTML 4.0 draft specification deprecated its use in 1997. These flaws include: .The GETmethod is not suitable for logins because the username and password are fully visible onscreen as well as potentially stored in the client browser s memory asavisited page. .Every GETsubmission is recorded in the Web server log, data set included. .Because the GETmethod assigns data to a server environment variable, the length ofthe URL is limited. You may have seen what seem like very long URLs using GET butyou really wouldn t want to try passing a 300-word chunk of HTML-formatted proseusing this method. The original HTML spec called for query strings to be limited to 255 characters. Although thisstricture was later loosened to mere encouragement of a 255-character limit, using a longerstring is asking for trouble. The GETmethod of form handling had to be reinstated by the W3C after much outcry, largelybecause of the bookmarkability factor. Despite that it s still implemented as the defaultchoice for form handling in all browsers, GETnow comes with a strong recommendation todeploy it in idempotentusages only in other words, those that have no permanent sideeffects. Putting two and two together, the single most appropriate form-handling use of GETis the search box. Unless you have a compelling reason to use GETfor non-search-box formhandling, use POSTinstead. A Better Use for GET-Style URLsAlthough the actual GETmethod of form handling is deprecated, the style of URL associatedwith it turns out to be very useful for site navigation. This is especially true for dynamicallygenerated sites such as those often constructed with PHP, because the appended-variablestyle of URL works particularly smoothly with a template-based content-development system. As an illustration, imagine you are the proud proprietor of an information-rich Web site aboutsolar cars. You ve toiled long and hard over informative and attractive pages such as these: suspension_design.htmlwindtunnel_testing.htmlfriction_braking.htmlBut as your site grows, a flat-file site structure like this can take a lot of time to administer, aseven the most trivial changes must be repeated on every page. If the structure of these pagesis very similar, you might want to move to a template-based system with PHP. You might decide to utilize a single template with separate text files for each topic (containinginformation, photos, comments, and so on): topic.phpsuspension_design.incwindtunnel_testing.incfriction_braking.incCaution09
Searching for affordable and reliable webhost to host and run your web applications? Go to our java web server services and you will be pleased.