HTML Diff
0 added 0 removed
Original 2026-01-01
Modified 2026-03-09
1 <p>Sales fell, and Dumpo restored the original version of the website. Since we are now finished with the main page, we now need to add two more pages to the site: a catalog and a product listing. Let’s start with the catalog.</p>
1 <p>Sales fell, and Dumpo restored the original version of the website. Since we are now finished with the main page, we now need to add two more pages to the site: a catalog and a product listing. Let’s start with the catalog.</p>
2 <p>We need to create a script in order for the new page to appear. A script is a collection of commands that solves a particular problem. For example, the index.php script is responsible for assembling the main page of the store using require.</p>
2 <p>We need to create a script in order for the new page to appear. A script is a collection of commands that solves a particular problem. For example, the index.php script is responsible for assembling the main page of the store using require.</p>
3 <p>In order to create a new script, we need to create a file and assign it a name. Then open the file in the mini browser to see the result of executing the script code. After that, you can write the code. A file has already been created for the catalog. It is called catalog.php.</p>
3 <p>In order to create a new script, we need to create a file and assign it a name. Then open the file in the mini browser to see the result of executing the script code. After that, you can write the code. A file has already been created for the catalog. It is called catalog.php.</p>
4 <p>For the PHP code to work, it must be placed inside PHP tags:</p>
4 <p>For the PHP code to work, it must be placed inside PHP tags:</p>
5 &lt;?php // Opening PHP tag require('file.php'); // Some sort of PHP code ?&gt; // Closing PHP tag<p>These tags function as a signal. When we use them, we are saying something like “Pay attention: there is PHP code inside”.</p>
5 &lt;?php // Opening PHP tag require('file.php'); // Some sort of PHP code ?&gt; // Closing PHP tag<p>These tags function as a signal. When we use them, we are saying something like “Pay attention: there is PHP code inside”.</p>
6 <p>We will write the opening and closing PHP tags and then include the header component components/header.php using require.</p>
6 <p>We will write the opening and closing PHP tags and then include the header component components/header.php using require.</p>
7 <p>A file with code from a particular semantic section of the page is called a component. For example, we have a header, footer, page content component.</p>
7 <p>A file with code from a particular semantic section of the page is called a component. For example, we have a header, footer, page content component.</p>