Introducing the World Wide Web

    The World Wide Web, commonly know as the Web, is an information and resource sharing system consists of servers and clients, who are connected together by hyperlinks. The documents and resources of the Web are requested by the browser and then transferred via the Hypertext Transfer Protocol (HTTP), which can then be displayed in the browser.

    Before we can start our course on web development, there are some basic concepts that we need to understand about the Web. First, let talk about what is a server and what is a client, and how they are able to communicate with each other.

    Client and Server

    The Client and the Server are just different names for computers with different functions. When you open your computer and request a document with the browser, your computer is called the client, and the computer that sends you the document is called the server.

    As you probably already know, to request a document, you need to put an URL (Uniform Resource Locator) in the browser, and hit enter. However, the question remains, what exactly happens after that?

    URL and DNS

    A URL is a reference to a resource (document, image, video…) which specifies its location on the server. A typical URL has the form http://www.example.com/index.html, which indicates a transfer protocol (http), a hostname (www.example.com), and a file name (indel.html). Each hostname corresponds to the IP address of a server.

    The problem is, how does the browser know the IP address when you only give it a hostname? There are about 1 billion hostnames in the world, and there is no way your computer could store all of them. Instead, we have DNS (Domain Name Servers) to store that information for us. There are only 13 DNS root servers in the world, and they act as the registry book for the Web.

    So, when you hit enter, the browser first goes to the DNS server and finds the correct IP address of the server based on the hostname, and then, the browser will send an HTTP request to that server.

    HTTP

    HTTP is a type of TCP/IP (Transmission Control Protocol/Internet Protocol) that allows the communication between the client and the server. The client will send a request to the server, and then the server will send a response back to the client.

    There are several request methods defined in HTTP, and each of them indicates a different action to be performed for a given resource.

    For example, if you want to retrieve something from the server, you use the GET method.

    If you want to check if the desired resource is there without retrieving them, you use the HEAD method.

    If you want to send something to the server, you use the POST or the PUT method. The difference between the POST and the PUT method is that if the resource already exists, PUT will replace it with the new one.

    After the client sends the HTTP request to the server, if the server is OK with that request, it will send a “200 OK” response back to the client, and start transferring the requested resource.

    The resources we are talking about here are usually HTML, CSS, and JavaScript files. We’ll talk about them next.

    Static Web Page

    The HyperText Markup Language (HTML) is the most fundamental component of the web. It defines the structure and content of every web page.

    Cascading Style Sheets (CSS) is a style sheet language used for describing the appearance of an HTML document. It can be used to define the color, shape, and style of any HTML element.

    JavaScript is used to define how a web page would interact with the user. For example, you have a button in an HTML document, and you want an image to pop up when the user clicks on it. In this case, you will need to use JavaScript to define this action.

    These technologies can be used to create static web pages. The static web pages are the ones that are delivered to your browser exactly as they are stored on the server. Meaning if you want to change something on that page, you have to change the HTML code directly, which is fine if you only have a few pages. However, it becomes more and more tedious as your website grows. We need a more efficient method to handle this problem.

    Dynamic Web Page

    The dynamic web pages are the ones that are generated by the server and sent to the client when it was requested. The generation is based on information stored in the database. So, if you want to change something, all you need to do is to change the information in the database.

    Although JavaScript can also be used in the backend with Node.js, we are not going to talk about it right now. In this course, we are going with a more conventional way and study two other languages that can be used in the backend, PHP and Python.

    Leave a Reply

    Your email address will not be published. Required fields are marked *