title: On click instead of going to the link/page, open the page inside a div
body: <p>Here I have a  link</p>
  
  <pre><code> &lt;h2 data-toggle="modal" data-target="#myModal"&gt;
   &lt;a href="post.php?id=&lt;?php echo $post_id;?&gt;"&gt;  post  &lt;/a&gt;  &lt;/h2&gt;
  </code></pre>
  
  <p>when the link is clicked it goes to <code>post.php?id=1</code></p>
  
  <p>How can I prevent going to this link  but at a same time  open this  inside
  the div below ?</p>
  
  <p>Note: Anything is put inside the div will automatically show cause it is a modal div. </p>
  
  <p>All I need is to  include the post.php inside the div with id and prevent from going going to the <code>post.php?id=1</code> </p>
  
  <pre><code> &lt;h2 data-toggle="modal" data-target="#myModal"&gt;
   &lt;a href="post.php?id=&lt;?php echo $post_id;?&gt;"&gt;  post  &lt;/a&gt;  &lt;/h2&gt;
  
  
  &lt;div id="myModal" class="modal fade" role="dialog"&gt;
  &lt;div class="modal-dialog"&gt;
  
  &lt;!-- Modal content--&gt;
  &lt;div class="modal-content"&gt;
    &lt;div class="modal-header"&gt;
      &lt;button type="button" class="close" data-dismiss="modal"&gt;&amp;times;&lt;/button&gt;
      &lt;h4 class="modal-title"&gt;Edit Post&lt;/h4&gt;
    &lt;/div&gt;
    &lt;div class="modal-body"&gt;
  
      &lt;div&gt;     
  
  
  
  
            //include post.php inside here with id
  
  
  
  
      &lt;/div&gt;
  
    &lt;/div&gt;
    &lt;div class="modal-footer"&gt;
      &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Close&lt;/button&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>
  </p>
  
  <p>here is the post.php: `</p>
  
  <pre><code>&lt;?php 
  
  include("includes/connect.php");
  
  if(isset($_GET['id'])){
  
  $get_id = $_GET['id'];
  
  $get_query = "select * from posts where post_id='$get_id'";
  
  $run_query = mysql_query($get_query); 
  
  while ($row=mysql_fetch_array($run_query)){
  
  
      $post_id = $row['post_id'];
      $post_title = $row['post_title'];
  
      $post_image = $row['post_image'];
  
  }
  }
  ?&gt;`
  &lt;div&gt;
  
   &lt;h2&gt; &lt;?php echo $post_title;?&gt; &lt;/h2&gt;  
  
  
  &lt;/div&gt;
  </code></pre>