PHP code from a PHP file can be embedded in another PHP file.
$_SERVER["DOCUMENT_ROOT"] is used to get website root directory
if(isset($_GET['param'])) { }
<html> <body> <?php if(isset($_GET['param'])) { $param= $_GET['param']; include ('path/'.$param.'.php'); } else { include ('path/default.php'); } ?> </body> </html>
<html> <head> <?php if(isset($_GET['param'])) { $param= $_GET['page']; include ('path/'.$param.'.php'); } else { include ('path/default.php'); } ?> </head> <body> </body> </html>
<?php if(isset($_GET['param'])) { $page_name = $_GET['param']; include ('path/'.$param.'.php'); } else { include ('path/default.php'); } ?>