title: Delete item from mysql database then go back to last page
body: <p>I have a page where I list items ( in this case businesses) that are pulled from a mysql database with php. </p>
  
  <pre><code>&lt;? 
      include('config.php');
      echo "&lt;h3&gt;Saved Businesses&lt;/h3&gt;";
      echo "&lt;ul style='list-style-type:none;'&gt;";
      $result = mysql_query("SELECT * FROM `saved_biz` WHERE user_id = '$id'") or trigger_error(mysql_error()); 
      while($row = mysql_fetch_array($result)){
  
          foreach($row AS $key =&gt; $value) { $row[$key] = stripslashes($value); }
              $business_id = $row['business_id'];
              $result = mysql_query("SELECT * FROM `company` WHERE id = '$business_id'") or trigger_error(mysql_error());
              while($row = mysql_fetch_array($result)){
                  $business_name = $row['name'];
              }
          echo "&lt;li&gt;" . nl2br( $business_name);  
          echo "&lt;a href=deletesavedbiz.php?id={$row['id']}&gt;Delete&lt;/a&gt;&lt;/li&gt;"; 
          echo "&lt;/tr&gt;"; 
      } 
      echo "&lt;/ul&gt;"; 
  ?&gt;
  </code></pre>
  
  <p>If the user decides to delete one of the businesses ( by clicking the "Delete" link ) he/she is then taken to deletesavedbiz.php and then, if successful, presented with a link to get back to the profile.php page that he/she was just on. </p>
  
  <pre><code>&lt;? 
      include('config.php'); 
      $id = (int) $_GET['id']; 
      mysql_query("DELETE FROM `saved_biz` WHERE `id` = '$id' ") ; 
      echo (mysql_affected_rows()) ? "Row deleted.&lt;br /&gt; " : "Nothing deleted.&lt;br /&gt; "; 
  ?&gt; 
  
  &lt;a href='profile.php'&gt;Back To Listing&lt;/a&gt;
  </code></pre>
  
  <p>Now, what I want to do is have the php delete and then do like a php header redirect to profile.php without ever making the user click a link back. How can I accomplish this? Also, I'm fine with having the answer being javascript if it's not possible or not very clean in PHP.</p>
  
  <p>Thanks for all help!</p>