title: Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\project\advancebrowsing.php:132)
body: <p>I'm doing a project for my school and I wrote this page but for some reason I get 2 warnings in the end about header info already sent on line 132 but on line 132 all I have is the php tag</p>
  
  <p>I would really appreciate it if I can get some help, I wrote this code in 1 hour but trying to solve this problem for the past 2 hours ...
  Finally got tired and decided to ask it</p>
  
  <p>here is my code </p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
  &lt;form method="POST"&gt;
  Browse By Author's name starting with :&lt;select name="author"&gt;
  &lt;option value=""&gt;--Select--&lt;/option&gt;
  &lt;option value="A"&gt;A&lt;/option&gt;
  &lt;option value="B"&gt;B&lt;/option&gt;
  &lt;option value="C"&gt;C&lt;/option&gt;
  &lt;option value="D"&gt;D&lt;/option&gt;
  &lt;option value="E"&gt;E&lt;/option&gt;
  &lt;option value="F"&gt;F&lt;/option&gt;
  &lt;option value="G"&gt;G&lt;/option&gt;
  &lt;option value="H"&gt;H&lt;/option&gt;
  &lt;option value="I"&gt;I&lt;/option&gt;
  &lt;option value="J"&gt;J&lt;/option&gt;
  &lt;option value="K"&gt;K&lt;/option&gt;
  &lt;option value="L"&gt;L&lt;/option&gt;
  &lt;option value="M"&gt;M&lt;/option&gt;
  &lt;option value="N"&gt;N&lt;/option&gt;
  &lt;option value="O"&gt;O&lt;/option&gt;
  &lt;option value="P"&gt;P&lt;/option&gt;
  &lt;option value="Q"&gt;Q&lt;/option&gt;
  &lt;option value="R"&gt;R&lt;/option&gt;
  &lt;option value="S"&gt;S&lt;/option&gt;
  &lt;option value="T"&gt;T&lt;/option&gt;
  &lt;option value="U"&gt;U&lt;/option&gt;
  &lt;option value="V"&gt;V&lt;/option&gt;
  &lt;option value="W"&gt;W&lt;/option&gt;
  &lt;option value="X"&gt;X&lt;/option&gt;
  &lt;option value="Y"&gt;Y&lt;/option&gt;
  &lt;option value="Z"&gt;Z&lt;/option&gt;
  &lt;/select&gt;&lt;br&gt;&lt;br&gt;
  
  Browse by Title start with :&lt;select name="title"&gt;
  &lt;option value=""&gt;--Select--&lt;/option&gt;
  &lt;option value="A"&gt;A&lt;/option&gt;
  &lt;option value="B"&gt;B&lt;/option&gt;
  &lt;option value="C"&gt;C&lt;/option&gt;
  &lt;option value="D"&gt;D&lt;/option&gt;
  &lt;option value="E"&gt;E&lt;/option&gt;
  &lt;option value="F"&gt;F&lt;/option&gt;
  &lt;option value="G"&gt;G&lt;/option&gt;
  &lt;option value="H"&gt;H&lt;/option&gt;
  &lt;option value="I"&gt;I&lt;/option&gt;
  &lt;option value="J"&gt;J&lt;/option&gt;
  &lt;option value="K"&gt;K&lt;/option&gt;
  &lt;option value="L"&gt;L&lt;/option&gt;
  &lt;option value="M"&gt;M&lt;/option&gt;
  &lt;option value="N"&gt;N&lt;/option&gt;
  &lt;option value="O"&gt;O&lt;/option&gt;
  &lt;option value="P"&gt;P&lt;/option&gt;
  &lt;option value="Q"&gt;Q&lt;/option&gt;
  &lt;option value="R"&gt;R&lt;/option&gt;
  &lt;option value="S"&gt;S&lt;/option&gt;
  &lt;option value="T"&gt;T&lt;/option&gt;
  &lt;option value="U"&gt;U&lt;/option&gt;
  &lt;option value="V"&gt;V&lt;/option&gt;
  &lt;option value="W"&gt;W&lt;/option&gt;
  &lt;option value="X"&gt;X&lt;/option&gt;
  &lt;option value="Y"&gt;Y&lt;/option&gt;
  &lt;option value="Z"&gt;Z&lt;/option&gt;
  &lt;/select&gt;&lt;br&gt;&lt;br&gt;
  
  Browse by Publisher start with :&lt;select name="publisher"&gt;
  &lt;option value=""&gt;--Select--&lt;/option&gt;
  &lt;option value="A"&gt;A&lt;/option&gt;
  &lt;option value="B"&gt;B&lt;/option&gt;
  &lt;option value="C"&gt;C&lt;/option&gt;
  &lt;option value="D"&gt;D&lt;/option&gt;
  &lt;option value="E"&gt;E&lt;/option&gt;
  &lt;option value="F"&gt;F&lt;/option&gt;
  &lt;option value="G"&gt;G&lt;/option&gt;
  &lt;option value="H"&gt;H&lt;/option&gt;
  &lt;option value="I"&gt;I&lt;/option&gt;
  &lt;option value="J"&gt;J&lt;/option&gt;
  &lt;option value="K"&gt;K&lt;/option&gt;
  &lt;option value="L"&gt;L&lt;/option&gt;
  &lt;option value="M"&gt;M&lt;/option&gt;
  &lt;option value="N"&gt;N&lt;/option&gt;
  &lt;option value="O"&gt;O&lt;/option&gt;
  &lt;option value="P"&gt;P&lt;/option&gt;
  &lt;option value="Q"&gt;Q&lt;/option&gt;
  &lt;option value="R"&gt;R&lt;/option&gt;
  &lt;option value="S"&gt;S&lt;/option&gt;
  &lt;option value="T"&gt;T&lt;/option&gt;
  &lt;option value="U"&gt;U&lt;/option&gt;
  &lt;option value="V"&gt;V&lt;/option&gt;
  &lt;option value="W"&gt;W&lt;/option&gt;
  &lt;option value="X"&gt;X&lt;/option&gt;
  &lt;option value="Y"&gt;Y&lt;/option&gt;
  &lt;option value="Z"&gt;Z&lt;/option&gt;
  &lt;/select&gt;&lt;br&gt;&lt;br&gt;
  
  Browse by Genre:&lt;select name="genre"&gt;
  &lt;option value=""&gt;--Select--&lt;/option&gt;
  &lt;option value="fiction"&gt;Fiction&lt;/option&gt;
  &lt;option value="non-fiction"&gt;non-fiction&lt;/option&gt;
  &lt;option value="sciencefiction"&gt;science fiction&lt;/option&gt;
  &lt;/select&gt;&lt;br&gt;&lt;br&gt;
  
  Book Award: &lt;select name="bookaward"&gt;
  &lt;option value=""&gt;--Select--&lt;/option&gt;
  &lt;option value="1"&gt;Arthur Ellis Award&lt;/option&gt;
   &lt;option value="2"&gt;Booker Prize&lt;/option&gt;
   &lt;option value="3"&gt;Canadian Jewish Book Awards&lt;/option&gt;
   &lt;option value="4"&gt;Commonwealth Writers Prize&lt;/option&gt;
   &lt;option value="5"&gt;Dayne Ogilvie Prize&lt;/option&gt;
   &lt;option value="6"&gt;Edna Staebler Award&lt;/option&gt;
   &lt;option value="7"&gt;Geoffrey Bilson Award&lt;/option&gt;
   &lt;option value="8"&gt;Gerald Lampert Award&lt;/option&gt;
   &lt;option value="9"&gt;Griffin Poetry Prize&lt;/option&gt;
   &lt;option value="10"&gt;Governor General's Award&lt;/option&gt;
   &lt;option value="11"&gt;Commonwealth Writers Prize&lt;/option&gt;
   &lt;option value="12"&gt;Journey Prize&lt;/option&gt;
   &lt;option value="13"&gt;Lorne Pierce Medal&lt;/option&gt;
   &lt;option value="14"&gt;Wright Awards&lt;/option&gt;
   &lt;option value="15"&gt;Milton Acorn People's Poetry Award&lt;/option&gt;
   &lt;option value="16"&gt;Matt Cohen Award: In Celebration of a Writing Life&lt;/option&gt;
   &lt;option value="17"&gt;Norma Fleck Award&lt;/option&gt;
   &lt;option value="18"&gt;RBC Bronwen Wallace Award for Emerging Writers&lt;/option&gt;
   &lt;option value="19"&gt;Pat Lowther Award&lt;/option&gt;
   &lt;option value="20"&gt;Rogers Writers' Trust Fiction Prize&lt;/option&gt;
   &lt;option value="21"&gt; Wright Awards&lt;/option&gt;
   &lt;option value="22"&gt;Writers' Trust Distinguished Contribution Award&lt;/option&gt;
   &lt;option value="23"&gt;Writers' Trust Engel/Findley Award&lt;/option&gt;
   &lt;option value="24"&gt;Winterset Award&lt;/option&gt;
   &lt;option value="25"&gt;Hilary Weston Writers' Trust Prize for Nonfiction&lt;/option&gt;
   &lt;option value="26"&gt;Geoffrey Bilson Award&lt;/option&gt;
   &lt;/select&gt;&lt;br&gt;&lt;br&gt;
  &lt;input type="submit" name="submit" value="Browse"&gt;
  &lt;/form&gt;
  
  &lt;?php
  error_reporting(E_ERROR|E_WARNING);
  
  $con = mysql_connect("localhost", "root", "");
  
  if (!$con) {
  die('Connection Failed: ' . mysql_error());
  }
  
   if (mysql_select_db("elibrary",$con)){
  if ($_POST['submit']){
      $author = $_POST['author'];
      $title = $_POST['title'];
      $genre = $_POST['genre'];
      $publisher= $_POST['publisher'];
      $award= $_POST['bookaward'];
  
      if ($author != "") {
      $author1 = "author";
      $like1 = "like";
      $and1 = "and";
      }   
  
      if ($title != "") {
      $title1= "title";
      $like2 = "like";
      $and2 = "and";
      }   
  
      if ($genre != "") {
      $genre1="genre";
      $like3 = "like";
      $and3 = "and";
      }   
  
      if ($publisher != "") {
      $publisher1= "publisher";
      $like4 = "like";
      $and4 = "and";
      }   
  
      if ($award != "") {
      $award1= "bookawards.id";
      $like5 = "=";
      $and5 = "and";
      }
  
      $browse = ("select * from books,bookawards,bookrelations where books.id = bookrelations.bookid and bookawards.id = bookrelations.bookawardsid '".$and1."' '".$author1."' '".$like1."' '".$author."%' '".$and2."' '".$title1."' '".$like2."' '".$title."%' '".$and3."' '".$genre1."' '".$like3."' '".$genre."%' '".$and4."' '".$publisher1."' '".$like4."' '".$publisher."' '".$and5."' '".$award1."''".$like5."''".$award."'");
      setcookie("browse",$browse);
      header("Location: shop.php");
      exit(); 
      }
      }
  mysql_close();
  ?&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>