mrt003003 Posted December 2, 2006 Share Posted December 2, 2006 Hi, i was wondering if any body could help me. im receiving this error when trying to delete a record on my DBWarning: Cannot modify header information - headers already sent by (output started at C:\wamp\www\Jobs Database\job_delete.php:1) in C:\wamp\www\Jobs Database\job_delete.php on line 36This is the code for my page:<title>Delete Job</title><?php ob_start();require_once('Connections/job_db.php');?><?phpif ((isset($_GET['recordID'])) && ($_GET['recordID'] != "")) { $deleteSQL = "DELETE FROM jobs WHERE `Job ID`=" . $_GET['recordID']; mysql_select_db($database_job_db, $job_db); $Result1 = mysql_query($deleteSQL, $job_db) or die(mysql_error()); switch($_GET['retpage']){ case "complete"; $deleteGoTo = "job_by_complete.php"; break; case "username"; $deleteGoTo = "job_by_username.php"; break; case "date"; $deleteGoTo = "job_by_date.php"; break; case "incomplete"; $deleteGoTo = "job_by_uncomplete.php"; break; case "id"; $deleteGoTo = "job_by_id.php"; break; default: $deleteGoTo = "job_by_id.php"; } header(sprintf("Location: %s", $deleteGoTo));}ob_flush();?>If any body could help that would be great.Thank You very much :) Link to comment https://forums.phpfreaks.com/topic/29252-cannot-modify-header-information-headers-already-sent/ Share on other sites More sharing options...
kenrbnsn Posted December 2, 2006 Share Posted December 2, 2006 Move these lines[code]?phpob_start();require_once('Connections/job_db.php');?>[/code]to before the [code]<title>Delete Job</title>[/code]Ken Link to comment https://forums.phpfreaks.com/topic/29252-cannot-modify-header-information-headers-already-sent/#findComment-134079 Share on other sites More sharing options...
mrt003003 Posted December 2, 2006 Author Share Posted December 2, 2006 Hey thats brilliant,Did the trick!Thank You very much Tom Link to comment https://forums.phpfreaks.com/topic/29252-cannot-modify-header-information-headers-already-sent/#findComment-134080 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.