tags:

views:

62

answers:

3
$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);
+1  A: 

Your issue doesn't appear to be in this snippet of code; this happens if you've sent anything to the user before calling the header() function. You need to make sure you don't send any data to the client (e.g. echoing something), as that will cause the headers to be sent, which means they can't be modified.

Michael Mrozek
+1  A: 

One of the easy way to prevent any output to disrupt the method header is to use buffering at the beginning of the page.

Ex.:

<?php
ob_start(); // Start buffering //

echo "Some echo";
header('Location: thiswillwork.php');
?>
HoLyVieR
A: 

Make sure you don't have white-spaces before your php code.

Assaf Lavie