Finally convinced of the futility of a static site , as a more or less serious project, we will now only talk about a dynamic PHP site. The PHP programming language is widely used to create web projects of varying complexity, it is a very democratic language and allows you to create a working dynamic PHP site, both amateur and professional. IN other words, PHP is easy to learn, but it's much more difficult to do it professionally. I have already talked about separating logic from presentation and this is an important and basic principle! It may still be difficult for you to understand the essence of this approach, but you need to get used to the norms of high-quality coding at the very beginning. I repeat, PHP as such allows you to code even too frivolously and such programs will also work, hence the popularity of the language among beginners and low-skilled programmers .

resume penguin

It is worth noting that all web technologies easily interact with each other. CSS and JavaScript code is easily integrated into HTML and PHP code, in turn, HTML is integrated into PHP and vice versa, all this happens at the level of inserting code or connecting individual files. But, as in life, if something is permissible, it does not mean at all that it is right. There are good manners in programming as well, but this is not about that now.


So, having created the “skeleton” of our site written in HTML + CSS + JavaScript, we begin to organize the “engine” of our future dynamic PHP site. But before that, a little more about JavaScript and smoothly move on to PHP itself.

Briefly about JavaScript

dynamic php site







As already noted, JavaScript (aka JS, but not to be confused with JAVA) is executed on the client side, right in the browser, and serves mainly to extend the modest basic functionality of HTML (HTML 5 has much more of this functionality). Often (but not only) it is used to implement cross-browser compatibility. Of course, there are layout standards, but the browser has the last word . And it is not always developed in accordance with the standards of the World Wide Web Consortium (W3C) - an organization that develops layout standards. This is especially true of the donkey IE (the browser from Microsoft). Moreover, browsers also "arbitrarily" with the output of the page: they pull up blocks, change the display of fonts, etc. In my attempt to fix the blunder (a la unclosed, open / closed tag is not there)browsers make page output unpredictable. They are not villains, they just want all sites to look good, but each browser "helps" in its own way. So, in solving all these problems, we have to turn to JavaScript. But I give you all this information only for understanding, in comparison with JavaScript, what a dynamic site written in PHP is.

Briefly about PHP

dynamic php site







Direct PHPis a programming language for more serious tasks. You can create full-fledged applications on it, not only for the needs of a personal or corporate website. PHP code is executed on the server side, which has a positive effect on the speed of your site. In the case of PHP, the server itself processes the script and gives the result to the browser, that is, the resources of the client computer are used only to display the result of the script. The fact is that if the browser is an interpreter of the program code, then the processing of the program (script) consumes the resources of the user's computer, in the operating system of which this browser is installed. The PHP interpreter is installed on the web server and all resource costs fall on this remote computer. There are many more programming languages ​​that can be executed (interpreted) on the server side, PERL for example. We will not compare them, since it is difficult for a beginner to comprehend the intricacies of the differences. Let's just take PHP as a basis and move on to considering such a thing as the "engine" of the site. This was my third article on the basics of creating websites. In the next article, I propose to speculation what engine to make a site .