title: Bootstrap modal delete confirmation
body: <p>Good day! I've got a problem in my bootstrap modal where I want to delete a post using a modal. </p>
  
  <p>Here is my PHP code where it toggles the delete_modal.php</p>
  
  <pre><code>&lt;?php
      if ($row['member_id'] == $_SESSION['member_id']){
      echo " 
       &lt;div style='float:right;'&gt;
         &lt;a href='#&lt;?php echo $id; ?&gt;' data-toggle='modal' data-target='#myModal'&gt;Delete&lt;/a&gt;
       &lt;/div&gt;";}
  
      else{
      echo "
        &lt;div style='float:right;'&gt;
          &lt;a href='#'&gt;Delete&lt;/a&gt;
        &lt;/div&gt;";
      }
  ?&gt;
  </code></pre>
  
  <p>Next this is my delete_modal.php</p>
  
  <pre><code>&lt;div class="modal fade" id="myModal" 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;Modal Header&lt;/h4&gt;
          &lt;/div&gt;
  
          &lt;div class="modal-body"&gt;
            &lt;p&gt;Some text in the modal.&lt;/p&gt;
          &lt;/div&gt;
  
          &lt;div class="modal-footer"&gt;
            &lt;button  id="&lt;?php echo $id; ?&gt;" href="deleteposthome.php?id='.$row['post_id'].'" type="button" class="btn btn-danger" data-dismiss="modal"&gt;Delete&lt;/button&gt;
            &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Close&lt;/button&gt;
          &lt;/div&gt;
  
       &lt;/div&gt;                                       
     &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Now this is my deleteposthome.php </p>
  
  <pre><code>    &lt;?php
        require ("connection.php");  
      ?&gt;  
  
      &lt;?php
         $id =$_GET['id'];
        mysql_query("DELETE FROM posts WHERE post_id = '$id'")
        or die(mysql_error());    
      ?&gt;
  </code></pre>
  
  <p>I don't know how to get ID so that it can be deleted using modal ! please help me</p>