Dynamic pages in PHP. PHP. Dynamic page creation Write a page in php
So, friends, if you have reached this lesson, then you have managed to either install a local server or buy a hosting where you can work with PHP. Congratulations - that's a big step!
I will say briefly about PHP - this programming language is used all over the world and you can create sites of all levels of complexity on it, from business card sites to large portals. I think it is no longer a secret for many that the largest social media facebook.com(from scratch in php) and vk.com(engine in php) were written in PHP. So let's draw conclusions and start working!)
How the code works
PHP code processed on the server side. That is, there is no finished page. For example, in the code the command is given to collect data on how many users are currently registered on the site. Website visitor clicks on a link All users. He wants to get dynamic data, that is, those that are constantly changing. After the calculation on the server is completed, data will come from the server in the form of a generated HTML code of the page with the number of users. As a result, after clicking-request on the link, the user receives the page. If you view the code of the resulting page, you can see only HTML, and the PHP code will not be available for viewing. Roughly speaking, PHP is instructions to the server on how and from which blocks to make a page.What does PHP code look like and where should I paste it?
PHP code can be embedded directly into HTML. PHP code is embedded in HTML pages using angle brackets and a question mark , however, you can restrict yourself to brackets with question marks код; ?> . You will only need to change the file extension, for example from .html on .phpPHP code(file index.php)
echo "Hello world!";
?>