jwwceo Posted December 12, 2007 Share Posted December 12, 2007 Hello, I have a page where the header has stopped working. It used to work fine. There is no output before the header tag. Is there maybe an apache setting that disallows header functions? James <?php include 'library/config.php'; include 'library/opendb.php'; error_reporting(0); $shirt_id = $_GET['shirt_id']; if(isset($_POST['delete'])) { $query = "DELETE from shirts WHERE shirt_id='$shirt_id'"; $result = mysql_query($query) or die("Error: ". mysql_error(). " with query ". $query); mysql_query("DELETE FROM shirtkeywords WHERE shirt_id = '$shirt_id'") or die (mysql_query()); mysql_query("DELETE FROM shirtcolors WHERE shirt_id = '$shirt_id'") or die (mysql_query()); header("Location: http://www.liquidcotton.com/admin"); } Quote Link to comment Share on other sites More sharing options...
revraz Posted December 12, 2007 Share Posted December 12, 2007 Do you get a header error or does it just not redirect? Quote Link to comment Share on other sites More sharing options...
jwwceo Posted December 12, 2007 Author Share Posted December 12, 2007 It just doesn't redirect. It goes back to the same page, but the form is empty. So the delete query is working. It just isn't redirecting. Quote Link to comment Share on other sites More sharing options...
revraz Posted December 12, 2007 Share Posted December 12, 2007 You have error reporting off. Try setting it to E_ALL to see what errors out. Quote Link to comment Share on other sites More sharing options...
phpQuestioner Posted December 12, 2007 Share Posted December 12, 2007 check to see if your code is being completely evaluated from top to bottom - try this: <?php include 'library/config.php'; include 'library/opendb.php'; error_reporting(0); $shirt_id = $_GET['shirt_id']; if(isset($_POST['delete'])) { $query = "DELETE from shirts WHERE shirt_id='$shirt_id'"; $result = mysql_query($query) or die("Error: ". mysql_error(). " with query ". $query); mysql_query("DELETE FROM shirtkeywords WHERE shirt_id = '$shirt_id'") or die (mysql_query()); mysql_query("DELETE FROM shirtcolors WHERE shirt_id = '$shirt_id'") or die (mysql_query()); header("Location:refresh;url=http://www.liquidcotton.com/admin"); echo "Success - Delete Complete!\n"; } ?> do you see "Success - Delete Complete!"? Quote Link to comment Share on other sites More sharing options...
jwwceo Posted December 12, 2007 Author Share Posted December 12, 2007 Yes, the code is being completed. I get the output that the delete was successful, but then the empty form again... Quote Link to comment Share on other sites More sharing options...
revraz Posted December 12, 2007 Share Posted December 12, 2007 You have error reporting off. Try setting it to E_ALL to see what errors out. Quote Link to comment Share on other sites More sharing options...
jwwceo Posted December 12, 2007 Author Share Posted December 12, 2007 There was 1 line of incorrectly commented lines in my database connection file. this was counting as output I guess... the error setting showed me where it was. THANKS!!!! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.