A client, in general, refers to an entity that sends requests and usually expects an answer/response from the server designated by the request.
A server, in general, refers to an entity that answers requests with a reply. A server does not actively do much until it receives a request from a client.
“HTTP” stands for HyperText Transport Protocol. This is a networking protocol that allows a client to send a request and the server designated by the request to reply with a response.
An HTTP client is commonly known as a browser or web browser. Firefox, Chrome, Internet Explorer are commonly used browsers. When an end user types an URL on the address bar and presses the enter key, the web browser sends an HTTP request to the designated server.
Do not confuse HTTP with HTML. HTTP is a “transport protocol”, which means it is only specifying the standard that permits a client and a server interact. However, it does not, in any way, specifies how content is displayed.
“HTML” stands for HyperText Mark-up Language. This is a standard that specifies how content that is transmitted in plain text should be rendered by a browser.
Note that a document written in HTML does not need to be from a server. One can store HTML documents on a local hard disk drive and ask the browser to display (render) the documents.
You can view an HTML document as a collection of instructions to display content on the screen.
In CISW300, you learned how to create HTML documents. Combined with CSS (cascading stylesheets), HTML documents can specify some pretty fancy content to display. However, an HTML document that is stored on a server is static, it does not change. If you load an HTML document 200 times, it will load the same content all 200 times. This does not mean the document will look exactly the same all 200 times because Javascript, a client-side scripting language, can specify content that is dynamic.
Static content is okay in some applications. However, in general, content is dynamic. Most web sites need the same URL to display something different depending on many factors.
For example, an LMS (learning management system) URL should display an up-to-date score as assessments are being graded. The same URL to a grade book page should display updated content as an instructor grades entries in the grade book.
Likewise, an e-seller URL should also display an up-to-date price and stock status of an item. The same URL should load content that reflects the current price and stock status.
In the beginning of the Internet, most URLs specify static content. However, static content is fairly rare these days. Most URLs need to communicate with a database backend to display dynamic content that is based on up-to-date data stored in the database.
Most URLs that display dynamic content gets the raw data from a database. A database may not live on the same server as the HTTP server, but it is usually inaccessible to HTTP clients on the Internet for security reasons.
The database that provides dynamic data is accessible to an HTTP server.
Absolutely! If you have CLI (command line interface) access on a server machine and know the path to a PHP script, you can test run a PHP script manually.
On a CLI, type “php-cgi” preceeding the path of a PHP script to run it. For example, if “info.php” is in the current working directory, then the following command runs the script:
The output of the PHP interpreter is displayed on screen. It is an HTML document.
Running a PHP script manually is often helpful to debug a script that erroneously does not generate a proper HTML document.