SIM! No meu caso esse código é apenas de uma página de deleção de dados num DB. Em seguida ele deveria retornar à página "visualizar.php" mas ele dá esse erro... Eu tive o mesmo problema... " Warning: Cannot modify header information - headers already sent by (output started at C:\wamp\www\del_vizualizar.php:1) in C:\wamp\www\del_vizualizar.php on line 44" <?php virtual('/Connections/conexao.php'); ?>
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
if ((isset($_GET['ID'])) && ($_GET['ID'] != "")) {
$deleteSQL = sprintf("DELETE FROM chamados WHERE ID=%s",
GetSQLValueString($_GET['ID'], "int"));
mysql_select_db($database_conexao, $conexao);
$Result1 = mysql_query($deleteSQL, $conexao) or die(mysql_error());
$deleteGoTo = "visualizar.php";
if (isset($_SERVER['QUERY_STRING'])) {
$deleteGoTo .= (strpos($deleteGoTo, '?')) ? "&" : "?";
$deleteGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $deleteGoTo));
// header("Location: %s", $deleteGoTo);
}
?> Já tentei trocar o "header(sprintf("Location: %s", $deleteGoTo));" por "header("Location: %s", $deleteGoTo);". e não deu... já usei o "ob_start();" logo depois de "<?php" e nada também... Bom, como faço para fazer o retorno de página... já é o segundo código meu com esse problema e ainda não consegui resolver.alguém sabe como resolver? obrigado!