{"id":26390,"date":"2015-11-11T16:15:44","date_gmt":"2015-11-11T13:15:44","guid":{"rendered":"http:\/\/blog.superhosting.bg\/en\/?p=26390"},"modified":"2022-03-24T16:53:26","modified_gmt":"2022-03-24T14:53:26","slug":"website-how-it-works","status":"publish","type":"post","link":"https:\/\/blog.superhosting.bg\/en\/website-how-it-works.html","title":{"rendered":"How Does a Website Work?"},"content":{"rendered":"\n<p>If you are now starting your first online project and you are overwhelmed with loads of questions related to the operation of your future website, this is the right article for you! You remember that <a href=\"https:\/\/blog.superhosting.bg\/en\/new-superhosting-blog.html\" target=\"_blank\" rel=\"noreferrer noopener\">we promised to answer <\/a>these questions as well, don&#8217;t you? You will get convinced that when it comes to websites, there is no room for worry and nothing is as complicated as it seems at first glance. And we we&#8217;ll prove it to you! \ud83d\ude42\u00a0Are you ready for a short introductory IT overview? Ready, steady, go!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Welcome to your website&#8217;s home!<\/h2>\n\n\n\n<p>After you enter the domain (your website&#8217;s name) in the browser, it connects to the server where your website&#8217;s files are located. Before getting to that server your query goes through a long process which we have already described in more details (you can recall <a href=\"https:\/\/blog.superhosting.bg\/en\/dns-how-it-works-part1.html\" target=\"_blank\" rel=\"noreferrer noopener\">what a DNS is<\/a> and how it works). We already arrived on the server and can have a closer look at your website.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">In the beginning was the Code!<\/h2>\n\n\n\n<p>There are hundreds, even thousands lines of code which are standing behind every website&#8217;s beautiful and neat design. This code is written in languages which actually show to your browser what is on the website.<\/p>\n\n\n\n<p>The languages for building a website are HTML, CSS, PHP, Perl, Python, JavaScript, etc. They all have their place on the server, but the browser can read only three of them \u2013 HTML, CSS and JavaScript.<\/p>\n\n\n\n<p><strong>HTML<\/strong> (HyperText Markup Language) is a basic markup language on the web. It is called a markup language, because it uses &#8220;tags&#8221; to mark what the content is and how this content should be displayed on the website. However, HTML alone is not enough for building a good-looking and functional website. If using HTML only, your website will look as a plain text document. It will have neither any colors, nor fonts. This is where CSS comes to rescue!<\/p>\n\n\n\n<p><strong>CSS<\/strong> (Cascading Style Sheets) takes care of the content&#8217;s appearance. CSS renders the text font, size and color, size and color of different boxes, and the elements ordering on the webpage itself. It completes what the HTML code has done and gives a finished look of the design, but the website is still static and quite boring.<\/p>\n\n\n\n<p><strong>JavaScript<\/strong> is what makes your website <a href=\"https:\/\/blog.superhosting.bg\/en\/jquery.html\" target=\"_blank\" rel=\"noreferrer noopener\">dynamic<\/a>. With JavaScript you can add drop-down menus, pop-ups and also set up scenarios for what will happen if a website visitor writes something on the website. JavaScript is commonly used for creating drop-down menus and setting up rules (error messages, for example, when you enter fewer digits for a mobile number).<\/p>\n\n\n\n<p>The rest of the languages as <strong>PHP, Perl, Python, Ruby on Rails<\/strong> and others are processed on the server. Because of them your website visitors can perform all kind of activities (registering, placing orders, posting comments or statuses, etc.)<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How does this happen?<\/h2>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"600\" height=\"700\" src=\"https:\/\/blog.superhosting.bg\/wp-content\/uploads\/2015\/11\/website-how-it-works-01.jpg\" alt=\"How Does a Website Work?\" class=\"wp-image-63407\" srcset=\"https:\/\/blog.superhosting.bg\/wp-content\/uploads\/2015\/11\/website-how-it-works-01.jpg 600w, https:\/\/blog.superhosting.bg\/wp-content\/uploads\/2015\/11\/website-how-it-works-01-420x490.jpg 420w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/figure><\/div>\n\n\n\n<p><strong>Example: <\/strong><br>We will give you a simple example with the most common language \u2013 <strong>PHP<\/strong>.<br>The first step when loading a website is to enter the domain in the browser. The browser connects to the server, where the files are located (1). Let&#8217;s, for example, say that your website visitors want to register with it. Using <strong>HTML<\/strong>, <strong>CSS<\/strong> and <strong>JavaScript<\/strong> you can create a registration form. For this form to work properly, the data entered by a certain visitor should be processed and saved. This happens because of <strong>PHP<\/strong> (2). There is a separate .php file on the <strong>web server<\/strong>, where the script is saved that will make possible the data saving process. The data itself will be saved in the database (3) which is also located on the server. The database uses another language (for example <strong>SQL<\/strong>) that helps organizing and storing the collected data. Once registered on the website, the user can do many things, i.e. to comment articles and review products, to place orders as well as to communicate with other users. \u0415\u0430ch time this happens, <strong>PHP<\/strong> (2) connects to the database (3) and requires information for the respective profile. The information is loaded as a <strong>HTML<\/strong> and <strong>CSS<\/strong> (4) and the browser can read it (5).<\/p>\n\n\n\n<p><strong>Important:<\/strong> In order for the browser to communicate with the PHP scripts, they have to be translated into HTML and CCS.<\/p>\n\n\n\n<p>When there are many visitors on your website, they generate numerous queries which initiate PHP and SQL processes. An ordinary computer cannot process so much information in such a short time. So, if you wish to have a good-looking and well-functioning website which users like, you should host it on a server. Server space is offered by the <strong>hosting service<\/strong>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Can I build a website on my own?<\/h2>\n\n\n\n<p>Writing a code that performs similar functions, is quite a difficult task and not everyone can handle it. The good news is that there are platforms (content management systems) through which you can build a website easily and quickly. These platforms are also based on programming languages, but the code is already written. You only need to have an idea, to add content, and with just a few clicks you will have an up and running website. We will tell you more about them in the following articles.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you are overwhelmed with loads of questions related to the operation of your future website, this is the right article for you!<\/p>\n","protected":false},"author":7,"featured_media":61456,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"categories":[31],"tags":[],"class_list":{"0":"post-26390","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-superhosting-technology"},"aioseo_notices":[],"modified_by":"\u041c\u0430\u0434\u043b\u0435\u043d\u0430 \u041c\u0435\u0442\u043e\u0434\u0438\u0435\u0432\u0430","post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/blog.superhosting.bg\/en\/wp-json\/wp\/v2\/posts\/26390","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.superhosting.bg\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.superhosting.bg\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.superhosting.bg\/en\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.superhosting.bg\/en\/wp-json\/wp\/v2\/comments?post=26390"}],"version-history":[{"count":5,"href":"https:\/\/blog.superhosting.bg\/en\/wp-json\/wp\/v2\/posts\/26390\/revisions"}],"predecessor-version":[{"id":63703,"href":"https:\/\/blog.superhosting.bg\/en\/wp-json\/wp\/v2\/posts\/26390\/revisions\/63703"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.superhosting.bg\/en\/wp-json\/wp\/v2\/media\/61456"}],"wp:attachment":[{"href":"https:\/\/blog.superhosting.bg\/en\/wp-json\/wp\/v2\/media?parent=26390"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.superhosting.bg\/en\/wp-json\/wp\/v2\/categories?post=26390"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.superhosting.bg\/en\/wp-json\/wp\/v2\/tags?post=26390"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}