Delete image than redirect the page with query string i add query string with header but its not working Header not working
Error
headers already sent by output started at sidebar.php in delete.php
Delete.php
if(!isset($_SESSION['admin_email'])){
echo "<script>window.open('login.php','_self')</script>";
}
else {
if(isset($_GET['delete'])){
$id = $_GET['delete'];
$page = $_GET['page'];
$image = $_GET['image'];
$section = $_GET['section'];
$delete_p_cat = "delete from $page where id='$id' AND section = '$section'";
$run_delete = mysqli_query($con,$delete_p_cat);
if($run_delete)
{
  header('Location: index.php?view&page='.$page.'§ion='.$section);
  exit();
}
 }
} ?>
index page check if page exist than load the page sidebar included in index page index.php
   <div id="wrapper">
   <?php include("includes/sidebar.php");  ?>
  <div id="page-wrapper">
   <div class="container-fluid">
   <?php
   if(isset($_GET['dashboard'])){
    include("dashboard.php");
   }
    if(isset($_GET['view'])){
    include("view.php");
   }
   if(isset($_GET['delete'])){
    include("delete.php");
   }
   </div>
   </div>
  </div>
 
    