Website basics

posted in: Programmering | 0

Fundamentally a website is just some textfiles written in html and placed on a server, that transmits these textfiles to anyone who request them on tcp port 80 (or 437 for encrypted “secure” transmission. If the request is for the domainname without any added specific filename, the server will normally transmit the file index.htm – however this can be configured otherwise on the server. HTML is build up as text inside tags: The tag is telling the browser how the text should be interpreted. A full definition of all tags can be found at

The server will in most cases be able to execute a php script, that generates html content. The php script is just another file on the server and it is used for generating the html before it is sent. Most servers will look for index.php if index.htm or index.html doesn’t exist.

The request will normally come from a browserprogram, and the browser will know how to render the received html text to a formatted text.

The html text can be rather complex with a lot of formatting and positioning information. To make this a bit easier to handle, the formatting is often done in a separate css file. The html can include references to other files, a typical example is the inclusion of images where the tag information tells the browser something about the size that should be used for the display of the image, the positioning and so on.

And then the text can also include JavaScript, which is a programming language, that can be executed by the browser. Just like other programming languages the JavaScript can require some additional javascript libraries to inform the browser of how to execute the user-written JavaScript.

The first widespread definition of html (html 2.0) is still good html that can be interpreted by browsers, but the present newest version HTML 5 (in version 5.2) has a lot more possibilities, including some standards for accessing hardware on the unit with the browser (You might have seen a message like: “This homepage tries to access you webcamera”).

So a website, even with many pages can be written i native HTML and most likely include references to images and external css descriptions.

But when the site starts growing it quickly becomes an advantage to use a CMS. A CMS is a lot of php code, that generate the html files, that are sent out. But it is still html, that is sent from the server. The CMS is simply an easier way to maintain the content of the site.

The most common CMS is WordPress. WordPress has a well defined and open way of working, which makes it possible for a lot of programmers to add additional php code to the system: Themes and plugins – and there’s a lot of it.

One interesting and a bit special html tag is the iframe tag: It includes a reference to another html file that should be shown on this html page inside a window (frame) of the specified size.

Right now one of the challenges in websites is how to make it “responsive” – i.e how to transmit different html code based on the size of the unit, where the html file should be dispalyed.