How to make filename include variable depending on $_GET php
<p>To include php code in a file we do:</p>

<pre><code>    &lt;html&gt;
    &lt;body&gt;


    &lt;h1&gt;Welcome to my home page!&lt;/h1&gt;

    &lt;p&gt;Some text.&lt;/p&gt;
   &lt;?php include 'body.php'; ?&gt;    
    &lt;/body&gt;
    &lt;/html&gt;
</code></pre>

<p>Now I would like to include a file, the name will be passed in the url, so for example I wouldc do <code>www.site.com/file.php?name_of_file_to_include=body</code> to load body.php in the file: </p>

<pre><code>&lt;html&gt;
&lt;body&gt;

&lt;h1&gt;Welcome to my home page!&lt;/h1&gt;
&lt;p&gt;Some text.&lt;/p&gt;
&lt;? 
$file=$_GET["name_of_file_to_include"];
include $file.'.php'; 
?&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>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</p>
