headers already sent by <-- help me for this

i put this code at

<? if ($thisaction=='delete') { $query="DELETE FROM tblupdate WHERE ndex=$ndex"; $result=mysql_query($query); header("location:edited.php"); exit(); } ?>

i put this code in the same page where is my button delete too, and my code like this:
<a href=edited.php?ndex=’.$myndex.’&thisaction=delete title=“Delete” onclick=“if (!confirm(‘Are you sure you want to delete?’)) return false;”>
now if i click the delete button the error will be
Warning: Cannot modify header information - headers already sent by
and the error line is header(“location:edited.php”);

HTML is output, and output sends headers. Try moving the , and any other non-PHP characters below the PHP part that has the header() function.

thanks bord Zyppora :smiley: :smiley:

Sponsor our Newsletter | Privacy Policy | Terms of Service