title: How to execute code after a button is clicked in modal
body: <p>After the button "confirm" is clicked, I want to perform those operations. but my code doesn't run after the line `if (isset($_POST['confirm'])){..}
  i would really appreaciate your help. </p>
  
  <pre><code>echo "&lt;div class='container'&gt;
      &lt;form action='confirm.php' method='post'&gt;
      &lt;center&gt;&lt;button type='button' name='confirm' value='confirm' class='btn btn-info btn-lg' data-toggle='modal' data-target='#myModal'&gt;Confirm&lt;/button&gt;&lt;/center&gt;
      &lt;/form&gt;
      &lt;div class='modal fade' id='myModal' role='dialog'&gt;
      &lt;div class='modal-dialog'&gt;";
  
  
   if (isset($_POST['confirm'])){
  
          $query2 = "SELECT status FROM reserver WHERE picker='$picking' AND droper='$droping'";
          $result1 = mysqli_query($conn, $query2);
          $row1=mysqli_fetch_assoc($result1);
          $check_status=$row1['status'];
          if($check_status=='available')
          {
  
           $query3 = "UPDATE reserver SET status='reserved' WHERE picker='$picking' AND droper='$droping'";
           if(mysqli_query($conn, $query3)){
  
  
  
   echo " &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;Confirmation&lt;/h4&gt;
      &lt;/div&gt;
      &lt;div class='modal-body'&gt;
        &lt;p&gt;Confirmed Sucessfully!&lt;/p&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;";
           }
          }
        else  {
              echo " &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;Notice&lt;/h4&gt;
      &lt;/div&gt;
      &lt;div class='modal-body'&gt;
        &lt;p&gt;Unavailable Vehicle!&lt;/p&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>EDIT : now i have an else case for diaplaying unavailable vehicle</p>