The first web pages were created static, i.e. their content could not change without the coder and without intervening in the code. Since then, the situation has changed significantly, and majority of web pages is created dynamically, with their changing content generated on the server side. One of the languages used for pages generation is PHP (PHP Hypertext Pre-processor).

When Internet gained a huge popularity quickly, the web pages needed to be extended with the dynamic functionality. These efforts has gone so far that today you can write a web page or web-based application, which haves almost the same look and feel as a desktop application, e.g. Google Documents or Office365, whose look and feel resembles strongly Microsoft Office (Word, Excel, PowerPoint) on your desktop.

How does a web-based application work?

A web-based application functions in such way that the client issues a request or query for a certain server file. On the server side, so-called CGI script is running; this programme can generate a page with the content requested by the user. It means that no page “lies” on the server statically, and that it is generated dynamically according to the user’s needs. And PHP belongs to the most-CGI scripting languages, in which the web-based applications are written.

The usual scenario looks like this:

  1. The user enters a URL into the web browser (as e.g. socialNetwork.com/username) and this sends a request to the server.

  2. The server calls the appropriate PHP module.

  3. The PHP module processes the request, and based on the data it generates a HTML page (in this case the user wants to see his or her profule).

  4. The generated HTML page is sent to the client, which can see the web page generated dynamically according to his or her requirements.

All the users are stored in the database. PHP asks the database for the user data, and based on the result it generates a web page. You can easily imagine how complicated the maintenance were if each user had his or her own static HTML page.

It is obvious that the web-based applications have their future!