title: Prevent removing scripts after adding content in html with PHP
body: <p>I had pages that contain duplicate codes. I wrote this line of code and  used the query string to avoid repeating codes in every page:</p>
  
  <pre><code>$m=$_GET['m'];
  $p=$_GET['p'];
  include_once "$m/$p.php";
  </code></pre>
  
  <p><code>$m</code> is the directory that contains page <code>$p</code>. page <code>$p</code> is the content that must place in the non-fixed area of the main page. the main page is something like this:</p>
  
  <pre><code>&lt;body&gt;
  
      &lt;section id="container" class=""&gt;
          &lt;!--header start--&gt;
          &lt;header class="header white-bg"&gt;
  
          &lt;/header&gt;
  
          &lt;aside&gt;
              &lt;div id="sidebar" class="nav-collapse "&gt;
                  &lt;!-- sidebar menu start--&gt;
                  &lt;ul class="sidebar-menu"&gt;
                      &lt;li class="active"&gt;
                          &lt;a class="" href="siturl?m=index&amp;p=dashboard"&gt;
                              &lt;i class="icon-dashboard"&gt;&lt;/i&gt;
                              &lt;span&gt;dashboard&lt;/span&gt;
                          &lt;/a&gt;
                      &lt;/li&gt;
                  &lt;/ul&gt;
              &lt;/div&gt;
          &lt;/aside&gt;
  
          &lt;!--main content start--&gt;
          &lt;section id="main-content"&gt;
              &lt;section class="wrapper"&gt;
                  &lt;?
                      $m=$_GET['m'];
                      $p=$_GET['p'];
                      include_once "$m/$p.php";
                  ?&gt;
              &lt;/section&gt;
              &lt;!--main content end--&gt;
          &lt;/section&gt;
  
          &lt;script src="js/script1.js"&gt;&lt;/script&gt;
          &lt;script src="js/script2.js"&gt;&lt;/script&gt;
          &lt;script src="js/script3.js"&gt;&lt;/script&gt;
   &lt;/body&gt;
  </code></pre>
  
  <p>after I click on the links on the sidebar who defined like this:</p>
  
  <pre><code>&lt;a class="" href="siturl?m=index&amp;p=dashboard"&gt;
           &lt;i class="icon-dashboard"&gt;&lt;/i&gt;
           &lt;span&gt;dashboard&lt;/span&gt;
     &lt;/a&gt;
  </code></pre>
  
  <p>all scripts will be deleted despite they are out of the section that i placed content.</p>