title: How to stop PHP script and ask user yes or not
body: <p>Since PHP scripts are stateless is there any technique to stop script and ask user crucial question?
  I'm dealing with ask user when a I want to delete record from DB using delete.php</p>
  
  <p>my code example below</p>
  
  <pre><code>&lt;?php
      if(isset($_GET['id']) &amp;&amp; ctype_digit($_GET['id'])) {
          $id=$_GET['id'];
      }
      else header('Location: select.php');
  
      include 'dbconn.php';
      $sql = "DELETE FROM users WHERE id='$id'";
      echo "Are you sure?";
      $del=false;
      echo "&lt;a href='$del=true'&gt;yes&lt;/a&gt; &lt;a href='$del=false'&gt;no&lt;/a&gt;";
      if($del) $result = mysqli_query($conn,$sql);
      mysqli_close($conn);
      header('Location: select.php');
  </code></pre>