there was such a question: there is a site with a menu (when you click on the menu buttons, a new page of the site opens with certain information). In this version of the site, I pass the button press using the get function in a single php file and, depending on the value of the variable, draw this or that page. The value of the variable is checked in the same file. The question is, is it advisable to split the code of a single php file into several html files?
PS Below is part of the code of my php file. I ask a question in order to optimize the site as much as possible
<div class="roud"> <input type="button" class="r1" value="Главная" onclick=" location.href='my.php'"> <input type="button" class="r1" value="Услуги" onclick=" location.href='my.php?x=Услуги'"> <input type="button" class="r1" value="Техническое задание" onclick=" location.href='my.php?x=Техническое задание'"> <input type="button" class="r1" value="Контакты" onclick=" location.href='my.php?x=Контакты'"> <input type="button" class="r1" value="О нас" onclick=" location.href='my.php?x=О нас'"> <input type="image" class="r01" data-toggle="modal" data-target="#myModal" src="../images/viber1.png"> <input type="image" class="r01" data-toggle="modal" data-target="#myModal1" src="../images/WhatsApp1.png"> <input type="image" class="r01" data-toggle="modal" data-target="#myModal2" src="../images/telegram1.png"> </div> <?php if (isset($_GET["x"])) { $retur=$_GET["x"]; if ($retur=="Услуги"){ echo " ... "; } else { if ($retur=="Техническое задание"){ echo " ... "; } else { if ($retur=="Контакты"){ echo " ... "; } else { if ($retur=="О нас"){ echo " ... "; } } } } } else { echo " ... "; }