title: Show success message when deleted (query succesfull)
body: <p>I want to show a succes message when a field gets deleted succefully.</p>
  
  <p>I already have a confirmation alert that's working, but now I want to echo a message (or display it with js) that the query was succesfull.</p>
  
  <p>When I tried the if part it always shows post verwijdert (post deleted in dutch), but I want it to show after the confirmation alert.</p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta charset="utf-8"&gt;
  &lt;title&gt;Verwijderen&lt;/title&gt;
  &lt;header&gt;&lt;link rel="stylesheet" type="text/css" href="../css/style.css"&gt;
  
  
      &lt;script language="JavaScript" type="text/javascript"&gt;
              function delpage(id, title)
              {
                 if (confirm("Weet je zeker dat je '" + title + "' wilt verwijderen?"))
                 {
                    window.location.href = '?delpage=' + id;
                 }
              }
          &lt;/script&gt;
          &lt;/header&gt;
  
  &lt;body&gt;
      &lt;nav&gt;
      &lt;ul&gt;
      &lt;li&gt;&lt;a href="../index.php" target=_blank""&gt;Bekijk site&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="voegtoe.php"&gt;Toevoegen&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="verwijder.php"&gt;Verwijderen&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="?logout"&gt;Uitloggen&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
      &lt;/nav&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  
  &lt;div id="verwijder"&gt;
  
          &lt;?php
      include '../includes/includes.php';
  
      $blogPosts = GetBlogPosts();
  
  foreach ($blogPosts as $post)  
  {  
  }  
  
  //run if a page deletion has been requested
  if(isset($_GET['delpage'])){
  
      $delpage = $_GET['delpage'];
      $delpage = mysql_real_escape_string($delpage);
      $sql1 = mysql_query("DELETE FROM blog_posts WHERE id = '$delpage'");
      header('Location:verwijder.php');
      exit();
  }
  
  
  
  
  $sql = mysql_query("SELECT * FROM blog_posts ORDER BY id DESC");
  while($row = mysql_fetch_object($sql)) 
  {
          echo "&lt;tr&gt;";
          echo "&lt;h1&gt;&lt;td&gt;$row-&gt;title&lt;/td&gt;&lt;/h1&gt;";
          if($row-&gt;id == 0)
          { //home page verberg delete link
          } 
          else 
          {
              // delete functie waarbij een alert word weergegeven of je dit zeker wil
              echo "&lt;td&gt;&lt;a class='link' href=\"javascript:delpage('$row-&gt;id','$row-&gt;title');\"&gt;Verwijder&lt;/a&gt;&lt;/td&gt;";
          }
          echo "&lt;/tr&gt;";
  }
  
  if ($sql1 == !false)
  {
      echo '&lt;h1&gt;Post verwijdert&lt;/h1&gt;';
  }
  else
  {
      echo 'test';    
  }
  ?&gt;
  
  &lt;/div&gt;
  </code></pre>