tags:

views:

63

answers:

2

Possible Duplicates:
Warning: Cannot modify header information - headers already sent by
Cannot modify header information - headers already sent, Why its happening

HTML

<div class="side2 clearfix">
<?php
include('review.php');
?>
<br/><br/><br/><br/><br/><br/>
</div>
</div>
<div id="footer" class="clearfix">

review.php

<?php
$s=$_POST['name'];
if($s)
{
 $con = mysql_connect("localhost","root","stvroot");
 if (!$con)
  {  
  die('Could not connect: ' .mysql_error());
  }
 $dbselect=mysql_select_db("digifreshsystems", $con);
 $cus_name=$_POST['name'];
 $cus_email=$_POST['email'];
 $cus_description=$_POST['comments'];
 $type=$_POST['type'];
 $created=date("Y/m/d");
 $modified=date("Y/m/d");
$sql="insert into digifresh_review values('0','$created','$modified','$cus_name','$cus_email','$cus_description','$type')";
if (mysql_query($sql,$con))
 {
  ob_start(); // Start buffering //

  echo "Thankyou For Your Feedback";
  header('Location: ../digifresh/thankyou.php'); 
    }
else
    {
        die('Error: ' . mysql_error());
    }
 mysql_close($con);

}
else {
?>
+2  A: 

review.php can't redirect the user, because by the time review.php is called, you've already sent this to the browser:

<div class="side2 clearfix">
Matt
A: 

go to this thread: http://stackoverflow.com/questions/2979256/warning-cannot-modify-header-information-headers-already-sent-by

it contains a very elegant solution to your problem.

Nir Gavish