title: Echo confirm javascript with php
body: <p>I was wondering. Is there some possible way to echo a confirm javascript to confirm if delete values from database or not
  what i'm trying to do is this:</p>
  
  <pre><code> echo($strconfirm ="&lt;script&gt;javascript:confirm('Tem a certeza que pretende eliminar o registo?');&lt;/script&gt;");
  
                  if ($strconfirm == true)
                  {
  
                      $query="DELETE FROM softwares WHERE Idsoft='".$id."'";
                      $result=mysqli_query($ligabd,$query);
                      if (!$result)
                      {
                          echo("&lt;script&gt;javascript:alert('Erro ao eliminar o produto!');window.location='produtos.php';&lt;/script&gt;");
                      }
                      else
                      {
                          echo("&lt;script&gt;javascript:alert('Software eliminado com sucesso!');window.location='produtos.php';&lt;/script&gt;");
                      }
                  }
                  else
                  {
                      header("location:produtos.php");
                  }
  </code></pre>