Tham khảo tài liệu 'web client programming with perl-chapter 2: demystifying the browser-p2', công nghệ thông tin, quản trị web phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Chapter 2 Demystifying the Browser-P2 When you fill out a form the browser needs to send that information to the server along with the name of the program needed to process it. The program that processes the form information is called a CGI program. Let s look at how a browser makes a request from a form. Let s direct our browser to contact our hypothetical server and request the document GET HTTP Connection Keep-Alive User-Agent Mozilla WinNT I Host Accept image gif image x-xbitmap image jpeg image pjpeg The server responds with HTTP 200 OK Date Fri 04 Oct 1996 14 33 43 GMT Server Apache Content-type text html Content-length 547 Last-modified Tue 01 Oct 1996 08 48 02 GMT title Library Search title FORM ACTION http cgi-bin query METHOD POST Enter book title author or subject here p INPUT TYPE radio NAME querytype VALUE title CHECKED Title p INPUT TYPE radio NAME querytype VALUE author Author p INPUT TYPE radio NAME querytype VALUE subject Subject p Keywords input type text name queryconst value size 50 2 p BR Press DONE to start your search. hr input type submit value Done input type reset value Start over FORM The formatted document is shown in Figure 2-4. Figure 2-4. A HTML form rendered in the browser Enter boik Hl .-. author or subject litre Titls j Author O Subject ELeyitfet d Press DONE to start your search one start oyer Let s fill out the form and submit it as shown in Figure 2-5. Figure 2-5. Filling out the .