Warning: Cannot modify header information - headers already sent by

Posted by mohanraj on Stack Overflow See other posts from Stack Overflow or by mohanraj
Published on 2010-06-05T05:54:01Z Indexed on 2010/06/05 6:02 UTC
Read the original article Hit count: 214

Filed under:

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 {
?>

© Stack Overflow or respective owner

Warning: Cannot modify header information - headers already sent by

Posted by mohanraj on Stack Overflow See other posts from Stack Overflow or by mohanraj
Published on 2010-06-05T05:12:00Z Indexed on 2010/06/05 6:32 UTC
Read the original article Hit count: 214

Filed under:
$sql="insert into digifresh_review values('0','$created','$modified','$cus_name','$cus_email','$cus_description','$type')";
if (mysql_query($sql,$con))
{
    header("location: ../digifresh/thankyou.php");
}
else
{
    die('Error: ' . mysql_error());
}
mysql_close($con);

© Stack Overflow or respective owner

Related posts about php