Forum Moderators: coopster
[uk2.php.net...]
$title = $_POST['title'];
echo "$title";
$link = $_POST['link'];
echo "$link";
$content = $_POST['content'];
echo "$content";
$query = " INSERT INTO example(title,link,content) VALUES ('$title','$link','$content')";
$result = @ mysql_query($query,$connection) or die(mysql_error());
header("Location: [localhost...]
die;
?>
</html>
error: Warning: Cannot modify header information - headers already sent by (output started at C:\xamp\xampp\htdocs\noobgamers\updatepage.php:2) in C:\xamp\xampp\htdocs\noobgamers\updatepage.php on line 15
<? include "dbconn.php";
$query = " INSERT INTO example(title,link,content) VALUES ('$_POST['title']','$_POST['link']','$_POST['content']')";
$result = @ mysql_query($query,$connection) or die(mysql_error());
header("Location: [localhost...]
die;
?>
<?
include "dbconn.php";
$query = " INSERT INTO example(title,link,content) VALUES ('{$_POST['title']}','{$_POST['link']}','{$_POST['content']}')";
$result = @ mysql_query($query,$connection) or die(mysql_error());
header("Location: [localhost...]
die;
?>
This error now :
Warning: Cannot modify header information - headers already sent by (output started at C:\xamp\xampp\htdocs\noobgamers\updatepage.php:2) in C:\xamp\xampp\htdocs\noobgamers\updatepage.php on line 11
Warning: Cannot modify header information - headers already sent by (output started at C:\xamp\xampp\htdocs\noobgamers\updatepage.php:2) in C:\xamp\xampp\htdocs\noobgamers\updatepage.php on line 11
Are you sure this is ALL of the file and the exact same code?
In the error, it says line 11 contains the header function, however in the code you are posting, it apperars on line 8. The :2 after the url in the error says the line on which something is output to the page (If there is anything written before the script line 2 will contain the <? tag).
Check there is no typing before the php in your file, even a return will trigger this error.
<?
include "dbconn.php";
$query = " INSERT INTO example(title,link,content) VALUES ('{$_POST['title']}','{$_POST['link']}','{$_POST['content']}')";
$result = @ mysql_query($query,$connection) or die(mysql_error());
header("Location: [localhost...]
die;
?>
error:
Warning: Cannot modify header information - headers already sent by (output started at C:\xamp\xampp\htdocs\noobgamers\updatepage.php:2) in C:\xamp\xampp\htdocs\noobgamers\updatepage.php on line 11