Page 207 - Open Soource Technologies 304.indd
P. 207

Unit 9: Web Techniques



               •  Understand the server information                                               Notes
               •  Explain the processing forms

               •  Discuss the setting of response headers
               •  Discuss how to maintaining state in Web applications
               •  Explain about security socket layer

            Introduction

            PHP can provide dynamic content according to browser type, randomly generated numbers or
            User Input. It also demonstrated how the client browser can be redirected.
            PHP was designed as a web scripting language and, although it is possible to use it in purely
            command-line and GUI scripts, the Web accounts for the vast majority of PHP uses. A dynamic
            web  site  may  have  forms,  sessions,  and  sometimes  redirection,  and  this  unit  explains  how  to
            implement those things in PHP. You will also learn how PHP provides access to form parameters and
            uploaded files, how to send cookies and redirect the browser, how to use PHP sessions, and more.

            9.1 HTTP Basics


            HTTP or Hypertext Transfer Protocol is the network protocol used to transmit Web content over
            the Internet. It works with TCP/IP to transmit information. IP stands for Internet Protocol and
            TCP is the Transmission Control Protocol and both handles packaging information for delivery.
            HTTP handles addressing the package and providing information that allows the client and
            server to effectively communicate over the Web.
            Online application has numerous layers that it is working in or through. Each layer handles a
            specific aspect of the task at hand. For instance, when you open a Web browser, you have your
            operating system, your user account and preferences, the application, and the actual display of
            the page you are viewing all working together on the screen. On the Internet you have separate
            layers handling the transmission of data, the packaging of data, and the addressing of data.
            One way to grasp it is to imagine you work for a large wholesale company that delivers its own
            goods. The Transmission Control Protocol is like the delivery fleet that ships the goods. The
            Internet Protocol is the shipping room at the front of the warehouse, where things are pulled
            out of the warehouse (the server) and packaged for delivery to the client. Hypertext Transfer
            Protocol is the sales department that writes up the invoices and, more importantly, the shipping
            labels for the packers and drivers to use to figure out what to pack and where it goes.
            Most of what we talk about, when we talk about HTTP is the information it adds to the data
            package being shipped in order to increase the efficiency of delivery and the usability of the
            information on both sides of the transaction.

            In its simplest form, we can think of HTTP as nothing more than a header, or shipping label,
            and the protocols for processing the data in this header. If you have ever sent a package by
            UPS, then you know there is more to a shipping label than just the address it is being sent to.
            The HTTP header is a protocol that tries to pass all the information an application on the client
            or server may need from the other end of the transaction.
            An HTTP message can be broken into three parts:

               •  the request/response line
               •  the HTTP header
               •  the body of the message


                                             LOVELY PROFESSIONAL UNIVERSITY                                   201
   202   203   204   205   206   207   208   209   210   211   212