October 19, 2013

How PHP Works with the Web Server

How PHP Works with the Web Server

The normal process a Web server goes through to deliver a page to a browser is as
follows. It all begins when a browser makes a request for a Web page. Based on the URL,
the browser resolves the address of the Web server, identifies the page it would like, and
gives any other information the Web server may need. Some of this information is about
the browser itself, like its name (Mozilla), its version (25.1), or the operating system
(Linux). Other information given the Web server could include text the user typed into
form fields.

If the request is for an HTML file, the Web server will simply find the file, tell the
browser to expect some HTML text, and then send the contents of the file. The browser
gets the contents and begins rendering the page based on the HTML code. If you have
been programming HTML for any length of time, this will be clear to you.

Hopefully you have also had some experience with CGI scripts. When a Web server gets
a request for a CGI, it can't just send the contents of the file. It must execute the script
first. The script will generate some HTML code, which then gets sent to the browser. As
far as the browser is concerned, it's just getting HTML. The Web server does a bunch of
work that it gets very little recognition for, but Web servers rarely get the respect they
deserve. The medium is definitely not the message.

When a PHP page is requested, it is processed exactly like a CGI, at least to the extent
that the script is not simply sent to the browser. It is first passed through the PHP engine,
which gives the Web server HTML text.

0 comments:

Post a Comment

  • Blogger news

    This Blog Contains All Topics Related To Internet, Website Help, Interview Questions, News, Results From Various Resources, Visit Daily For More Interesting And Famous Topics.
  • Random Post

  • About

    We Provide All Information Which you Needed. We Maintain This Blog Very Carefully, If You Find Any Mistake or Any Suggestions Then Please Let Us Know, You Can Contact Us By Comments, On FB Page Or On Google+ Page. ~ Thank You