Hi!
I'm using this header('Location:index.php'); to get my page reload after user press the submit button.
It's working like a charm, but if you take a look at the PHP manual there is: "Remember that header() must be called before any actual output is sent, either by normal HTML tags, blank lines in a file, or from PHP".PHP Code:
if(isset($_POST['submit'])) {
$comment = $_POST['comment'];
$writer = $_POST['writer'];
$date_and_time = date('Y-m-d H:i:s');
mysql_query("INSERT INTO comment (writer, comment, date_and_time)
VALUES ('$writer', '$comment', '$date_and_time')")
or die(mysql_error());
header('Location:index.php');
}
So am I doing something very wrong or not?


?
Reply With Quote
Bookmarks