How PHP Works with the Web Server

 Published July 10,2010 in PHP

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 (4.08), or the operating system (Linux) called client information.

How PHP Works with the Web Server:

how php works with server

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. 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.

That's all for today. Hope you enjoyed my post!

Was this information useful? What other tips would you like to read about in the future?  Share your comments, feedback and experiences with us by commenting below!



Like our site? Be a member of Coolajax fan page to get daily posts updates!

recommended-tutorial You May Like This Posts!

» Classified Made Easy

» How to str_replace Function work?

» How to strip_tags function works?

» ucwords function in php

» How to strrev function work?

  tuts_view Total Read: 1408
blog comments powered by Disqus

Topics

Coolajax Fans

coolajax fan page on Facebook