开发者

Warning: Cannot modify header information - headers already sent by [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 10 开发者_Python百科years ago.
$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);


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');
?>


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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜