Jump to content

[SOLVED] Header not working..


jwwceo

Recommended Posts

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");

}

Link to comment
https://forums.phpfreaks.com/topic/81277-solved-header-not-working/
Share on other sites

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!"?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.