html - Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\project\advancebrowsing.php:132) -
this question has answer here:
- how fix “headers sent” error in php 11 answers
i'm doing project school , wrote page reason 2 warnings in end header info sent on line 132 on line 132 have php tag
i appreciate if can help, wrote code in 1 hour trying solve problem past 2 hours ... got tired , decided ask it
here code
<html> <body> <form method="post"> browse author's name starting :<select name="author"> <option value="">--select--</option> <option value="a">a</option> <option value="b">b</option> <option value="c">c</option> <option value="d">d</option> <option value="e">e</option> <option value="f">f</option> <option value="g">g</option> <option value="h">h</option> <option value="i">i</option> <option value="j">j</option> <option value="k">k</option> <option value="l">l</option> <option value="m">m</option> <option value="n">n</option> <option value="o">o</option> <option value="p">p</option> <option value="q">q</option> <option value="r">r</option> <option value="s">s</option> <option value="t">t</option> <option value="u">u</option> <option value="v">v</option> <option value="w">w</option> <option value="x">x</option> <option value="y">y</option> <option value="z">z</option> </select><br><br> browse title start :<select name="title"> <option value="">--select--</option> <option value="a">a</option> <option value="b">b</option> <option value="c">c</option> <option value="d">d</option> <option value="e">e</option> <option value="f">f</option> <option value="g">g</option> <option value="h">h</option> <option value="i">i</option> <option value="j">j</option> <option value="k">k</option> <option value="l">l</option> <option value="m">m</option> <option value="n">n</option> <option value="o">o</option> <option value="p">p</option> <option value="q">q</option> <option value="r">r</option> <option value="s">s</option> <option value="t">t</option> <option value="u">u</option> <option value="v">v</option> <option value="w">w</option> <option value="x">x</option> <option value="y">y</option> <option value="z">z</option> </select><br><br> browse publisher start :<select name="publisher"> <option value="">--select--</option> <option value="a">a</option> <option value="b">b</option> <option value="c">c</option> <option value="d">d</option> <option value="e">e</option> <option value="f">f</option> <option value="g">g</option> <option value="h">h</option> <option value="i">i</option> <option value="j">j</option> <option value="k">k</option> <option value="l">l</option> <option value="m">m</option> <option value="n">n</option> <option value="o">o</option> <option value="p">p</option> <option value="q">q</option> <option value="r">r</option> <option value="s">s</option> <option value="t">t</option> <option value="u">u</option> <option value="v">v</option> <option value="w">w</option> <option value="x">x</option> <option value="y">y</option> <option value="z">z</option> </select><br><br> browse genre:<select name="genre"> <option value="">--select--</option> <option value="fiction">fiction</option> <option value="non-fiction">non-fiction</option> <option value="sciencefiction">science fiction</option> </select><br><br> book award: <select name="bookaward"> <option value="">--select--</option> <option value="1">arthur ellis award</option> <option value="2">booker prize</option> <option value="3">canadian jewish book awards</option> <option value="4">commonwealth writers prize</option> <option value="5">dayne ogilvie prize</option> <option value="6">edna staebler award</option> <option value="7">geoffrey bilson award</option> <option value="8">gerald lampert award</option> <option value="9">griffin poetry prize</option> <option value="10">governor general's award</option> <option value="11">commonwealth writers prize</option> <option value="12">journey prize</option> <option value="13">lorne pierce medal</option> <option value="14">wright awards</option> <option value="15">milton acorn people's poetry award</option> <option value="16">matt cohen award: in celebration of writing life</option> <option value="17">norma fleck award</option> <option value="18">rbc bronwen wallace award emerging writers</option> <option value="19">pat lowther award</option> <option value="20">rogers writers' trust fiction prize</option> <option value="21"> wright awards</option> <option value="22">writers' trust distinguished contribution award</option> <option value="23">writers' trust engel/findley award</option> <option value="24">winterset award</option> <option value="25">hilary weston writers' trust prize nonfiction</option> <option value="26">geoffrey bilson award</option> </select><br><br> <input type="submit" name="submit" value="browse"> </form> <?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 * books,bookawards,bookrelations books.id = bookrelations.bookid , 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(); ?> </body> </html>
you need move php code top of page (before html).
for more detailed answer:
Comments
Post a Comment