Hi I've searched for solutions but I can't fixed it -_-
I've got a form, when I click submit it shows this error
Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\new1v2\topnav.php:72) in C:\xampp\htdocs\new1v2\alumnireg.php on line 68
This is a part of my php code
if (mysqli_query($conn, $sql) === TRUE) {
  echo 
  header('location:thanks.php');
where if I click submit it should go to thanks.php but if I remove my topnav.php It functions well
What is the problem with my topnav.php?
<!-- active class in navigation -->
<style>
  .active {
  background-color:#2980b9;
  }
</style>
<!-- end of active -->
<style>
  .nav li a:hover{
    background-color: #0452BC;
   /*font-size:18px;*/
 }
</style>
<script>
// Change style of top container on scroll
window.onscroll = function() {scrollFunc()};
function scrollFunc() {
if (document.body.scrollTop > 200 || document.documentElement.scrollTop > 200) {
    document.getElementById("myTop").classList.add("w3-blue","w3-card-4");
    document.getElementById("myIntro").classList.add("w3-show-inline-block");
} else {
    document.getElementById("myIntro").classList.remove("w3-show-inline-block");
    document.getElementById("myTop").classList.remove("w3-blue","w3-card-4");
}
}
</script>
<!-- for top nav to be not overlapped by the indicators of carousel -->
<style>
  .w3-card-4.w3-blue{z-index: 99999;}
</style>
<!-- end of style for top nav to be not overlapped -->
<div id="myTop" class="w3-top w3-container w3-padding-2 w3-theme w3-large">
  <!-- <i class="w3-opennav w3-hide-large w3-xlarge w3-margin-left w3-margin-right" onclick="w3_open()"></i> -->
  <div id="myIntro" class="w3-hide">
  <a href="index.php">
   <img src="admin/img/fcuautonomous.png" width="200px" height="50" style="padding:5px;">
  </a>
  </div>
</div>
<header class="w3-container w3-theme w3-padding-18 w3-blue" style="background-image: url(admin/img/top.jpg); background-size: 100% 100%;">
  <h1 class="w3-xxxlarge w3-padding-16">
   <a href="index.php">
   <img src="admin/img/fcuautonomous.png" width="400px">
  </a>
  </h1>
</header>
<nav class="w3-card-4" style="background-color: #013275;">
  <div class="container-fluid">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
        <i class="fa fa-chevron-circle-down" aria-hidden="true"></i>                       
      </button>
      <!-- <a class="navbar-brand" href="index.php"><b><img src="admin/img/fculogo.png" height="35" width="35"></b></a> -->
    </div>
    <div class="collapse navbar-collapse" id="myNavbar">
      <ul class="nav navbar-nav navbar-right">
        <li><a id='homie' href="index.php"><font color="white">Home</font></a></li>
        <li><a href="alumnireg.php"><font color="white">Alumni Registration</font></a></li>
        <li><a href="news_events.php"><font color="white">Events</font></a></li>
        <!-- <li><a href="job_opp.php"><font color="white">Job Oppurtunities</font></a></li> -->
        <li><a href="featured_alum.php"><font color="white">Featured Alumni</font></a></li>
        <li><a href="#contact"><font color="white">Photo Gallery</font></a></li>
      </ul>
    </div>
  </div>
</nav>
<br><br>
Please help, it's for my THESIS
 
     
     
    