Web Server Concept for Beginners
(October 2004)
Short explanation of terms appearing in the following diagram :
- Host
- synonym for a computer
- Web server
- program which serves web pages
This is what happens when a user wants to get a simple HTML file:
- The browser sends request for
index.html
to the remote web server (www.xyzt.com
)
- The web server sends the HTML file back without any more processing
Such a page is called static.
The following diagram shows how a web server will handle a request for a PHP file (PHP is an example, and many other methods behave the same way - ASP, cgi-bin programs, ...):
- The browser sends a GET request to the remote web server for a PHP file
- The web server recognizes the
.php
extension, and does a special processing on the PHP file in order to generate a temporary file
- The web server sends this temporary file back to the user
This is called server-side processing, because the processing is done in the server.
From this diagram, we naturally deduce what can be done by server-side processing:
- access to files on the web server
- access to a database on the web server
And what cannot be done:
- access to parameters of the browser window (action of closing the window,...)
- print on the local printer
- access files on the local printer
This shows how client-side processing occurs:
- The web browser sends a request for an HTML file
- The web server sends it back
- The web browser receives the
index.html
file and processes javascript, plug-ins (java, audio, video,...)
(this information is included in the index.html
file)
- The web browser displays the page
It is possible to use client-side processing and server-side processing for the same file.