title: How add confirmation box in php before deleting?
body: <p>I create one simple list in PHP where user can add Name, age, emails, etc. I added a delete option too, but I want to add a confirmation message when the user clicks on delete option.</p>
  
  <p>I tried searching Google but I found only jQuery and JavaScript solutions. Is there any way to do this with PHP only?</p>
  
  <p><strong>List.php</strong></p>
  
  <pre><code>&lt;?php
  
     include('config.php');
  
     $query1=mysql_query("select id, name, age from addd");
  
     echo "&lt;table&gt;&lt;tr&gt;&lt;td&gt;Name&lt;/td&gt;&lt;td&gt;Age&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;";
  
     while($query2=mysql_fetch_array($query1))
          {
             echo "&lt;tr&gt;&lt;td&gt;".$query2['name']."&lt;/td&gt;";
             echo "&lt;td&gt;".$query2['age']."&lt;/td&gt;";
             echo "&lt;td&gt;&lt;a href='edit.php?id=".$query2['id']."'&gt;Edit&lt;/a&gt;&lt;/td&gt;";
             echo "&lt;td&gt;&lt;a href='delete.php?id=".$query2['id']."'&gt;x&lt;/a&gt;&lt;/td&gt;&lt;tr&gt;";
          }
  
      &lt;/table&gt;
  ?&gt;
  </code></pre>
  
  <p><strong>Delete.php</strong></p>
  
  <pre><code>&lt;?php
  
      include('config.php');
      if(isset($_GET['id']))
        {
          $id=$_GET['id'];
          $query1=mysql_query("delete from addd where id='$id'");
          if($query1)
            {
            header('location:list.php');
            }
        }
  ?&gt;
  </code></pre>