Headers_send lokation
Er der en der kan hjælpe herhvordan kan man undgå dette problem ?
der udskrives denne fejlmeddelelse: Headers alredy send in xxx.xxxxx.dk/fil.php line 33
<?php
include("../connect.php");
$update = "NEJ";
if (isset($_GET["id"]))
{
$post[id] = $_GET["id"];
$result = mysql_query("SELECT * FROM vare_tabel WHERE id=" . $post[id]) or die(mysql_error());
$row = mysql_fetch_assoc($result);
$post[kat_id] = $row["kat_id"];
$post[vare_nr] = $row["vare_nr"];
$post[vare_navn] = $row["vare_navn"];
$post[vare_pris] = $row["vare_pris"];
$post[vare_beskrivelse] = $row["vare_beskrivelse"];
$post[vare_image] = $row["vare_image"];
}
else
{
$update = "JA";
$post[id] = $_POST["id"];
$post[kat_id] = $_POST["felt1"];
$post[vare_nr] = $_POST["felt2"];
$post[vare_navn] = $_POST["felt3"];
$post[vare_pris] = $_POST["felt4"];
$post[vare_beskrivelse] = $_POST["felt5"];
$post[vare_image] = $_POST["felt6"];
}
?>
Linje 33 <form method="post" action="<?=$PHP_SELF;?>">
<input type="hidden" name="id" value="<?=$post[id]?>">
<Pre >
Varegruppe id <INPUT TYPE='TEXT' NAME='felt1'value="<?=$post[kat_id];?>" SIZE="50" MAXLENGTH="25">
Varenummer <INPUT TYPE='TEXT' NAME='felt2'value="<?=$post[vare_nr];?>"SIZE="50" MAXLENGTH="25">
Varenavn <INPUT TYPE='TEXT' NAME='felt3'value="<?=$post[vare_navn];?>" SIZE="50" MAXLENGTH="25">
Pris <INPUT TYPE='TEXT' NAME='felt4'value="<?=$post[vare_pris];?>"SIZE="50" MAXLENGTH="25">
Vare beskrivelse <INPUT TYPE='TEXT' NAME='felt5'value="<?=$post[vare_beskrivelse];?>" SIZE="50" MAXLENGTH="25">
Vare foto ( fil navn) <INPUT TYPE='TEXT' NAME='felt6'value="<?=$post[vare_image];?>"SIZE="50" MAXLENGTH="25">
</pre>
</Pre >
<input type="submit" value="opdatér">
<input type="reset" name="B1" value="fortryd rettelse">
</form>
<?php
if ($update == "JA")
{
$SQL = "UPDATE vare_tabel SET
kat_id ='$post[kat_id]',
vare_nr ='$post[vare_nr]',
vare_navn ='$post[vare_navn]',
vare_pris ='$post[vare_pris]',
vare_beskrivelse ='$post[vare_beskrivelse]',
vare_image ='$post[vare_image]'
WHERE id='$post[id]'" or die(mysql_error());
mysql_query($SQL);
}
// An example using the optional file and line parameters, as of PHP 4.3.0
// Note that $filename and $linenum are passed in for later use.
// Do not assign them values beforehand.
if (!headers_sent($filename, $linenum)) {
header('Location: vis_indhold_i_tabel_vare.php');
exit;
// You would most likely trigger an error here.
} else {
echo "Headers already sent in $filename on line $linenum\n" .
"Cannot redirect, for now please click this <a " .
"href=\"vis_indhold_i_tabel_vare.php\">link</a> instead\n";
exit;
}
?>