To include php code in a file we do:
<html>
<body>
<h1>Welcome to my home page!</h1>
<p>Some text.</p>
<?php include 'body.php'; ?>
</body>
</html>
Now I would like to include a file, the name will be passed in the url, so for example I wouldc do www.site.com/file.php?name_of_file_to_include=body
to load body.php in the file:
<html>
<body>
<h1>Welcome to my home page!</h1>
<p>Some text.</p>
<?
$file=$_GET["name_of_file_to_include"];
include $file.'.php';
?>
</body>
</html>
Is this possible or Is it a better option to do this thing. The purpose to do so is because I will change only a part of the file, but there are lots of files I want to load