title: How to use PHP includes without changing the URL?
body: <p>I've written a simple php page that when you click on one of the links it includes a different php file, thereby changing the content. Below is the code I have so far, the only problem is that each time you click on a link, the URL changes to index.php?page=page1, which doesn't look very good. </p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;title&gt; PHP Includes &lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;h1&gt; This is the home page &lt;/h1&gt;
  &lt;ul&gt;
      &lt;li&gt;&lt;a href="includes.php?page=page1"&gt;Page1&lt;/a&gt; &lt;/li&gt;
      &lt;li&gt;&lt;a href="includes.php?page=page2"&gt;Page2&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="includes.php?page=page3"&gt;Page3&lt;/a&gt;&lt;/li&gt;
   &lt;/ul&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  
  
  &lt;div style='width:300px; height: 200px; border: 1px solid #000;'&gt;
  
  &lt;?php
  error_reporting(E_ALL ^ E_NOTICE);
  
  $page = $_GET['page'];
  $pages = array('page1', 'page2', 'page3');
  if (!empty($page)) {
      if(in_array($page,$pages)) {
          $page .= '.php';
          include($page);
      }
      else {
          echo 'Page not found. Return
          &lt;a href="includes.php"&gt;home&lt;/a&gt;';
      }
  }
  else {
      include('page1.php');
  }
  ?&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I was wondering if there was a way to do the same thing (just change the content), without changing the URL in the address bar?</p>