php - Warning: Cannot modify header information - headers already sent by (output) -


this question has answer here:

i'm getting error again , again try can't found solution

warning: cannot modify header information - headers sent (output started @ /home/xxxx/xxxx/forum/index.php:90) in /home/pappu/public_html/forum/index.php on line 93

here index.php code

<?php include_once("connect.php"); session_start(); ?> <html> <head> <title>myforum</title> <style type="text/css"> body { background-color: #333; margin-top: 150px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; } .content { background-color: #666; width: 960px; margin-right: auto; margin-left: auto; border-radius: 3px; -webkit-border-radius: 3px; -moz-border-radius: 3px; padding: 20px; } .content .categories { width: 700px; background-color: #333; border-radius: 3px; -webkit-border-radius: 3px; -moz-border-radius: 3px; margin: 0px; font-family: "trebuchet ms", arial, helvetica, sans-serif; color: #fff; } .categories .community_heading { font-family: "trebuchet ms", arial, helvetica, sans-serif; font-variant: normal; text-transform: capitalize; color: #ccc; margin: 0px; padding-top: 7px; padding-right: 7px; padding-bottom: 7px; padding-left: 14px; font-size: 18px; font-weight: bold; } .content .categories hr { background-color: #666; height: 3px; border: 0px; width: 700px; margin: 0px; }  .content .categories .cat_links { border-bottom-width: thin; border-bottom-style: solid; border-bottom-color: #000; padding-top: 7px; padding-right: 7px; padding-bottom: 7px; padding-left: 14px; font-size: 14px; color: #000; } .content .categories .cat_a { font-family: "trebuchet ms", arial, helvetica, sans-serif; font-size: 18px; font-variant: normal; text-transform: capitalize; color: #777; text-decoration: none; } .content .categories .cat_a:hover { text-decoration: underline; color: #ddd; } .content .categories .desc { margin: 0px; font-family: "trebuchet ms", arial, helvetica, sans-serif; font-size: 12px; font-weight: bold; color: #ccc; } </style> </head> <body> <?php if(!isset($_session['password'])) { include_once("location:header.php"); } else { header("location:member.php"); } ?> <div class="content"> <div class="categories"> <h3 class="community_heading">community</h3> <hr /> <?php $query = "select * categories order cat_id asc"; $result = mysql_query($query) or die(mysql_error()); $categories = ""; if(mysql_num_rows($result) > 0 ) { while($row = mysql_fetch_array($result)) { $cat_id = $row['cat_id']; $cat_title = $row['cat_title']; $cat_desc = $row['cat_description']; $categories .=" <div class='cat_links'> <a href='view_category?cid=".$cat_id."' class='cat_a'>$cat_title</a> <p class='desc'>$cat_desc</p> </div>"; } echo $categories ; } else  { } ?> </div> </div> </body> </html> 

you can't call header() after including code outputted page. need rewrite doing header() call above html code.


Comments

Popular posts from this blog

php - get table cell data from and place a copy in another table -

javascript - Mootools wait with Fx.Morph start -

php - Navigate throught databse rows -