Error Warning: Cannot modify header information - headers already sent by
Acabo de subir mi web al hosting y en todas las páginas donde puedo editar información (panel de administración) me dice
Warning: Cannot modify header information - headers already sent by (output started at /home/base de datos/public_html/carpeta de administracion/resolver-estado-de-preguntas.php:1) in/home/base de datos/public_html/barajas/resolver-estado-de-preguntas.php on line 49
Claro en este caso es la línea 49, pero varia en las diferentes hojas que cumplen la función de editar
Les muestro el código en cuestión
¿
¿<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($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;
}
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
$updateSQL = sprintf("UPDATE contacto SET Estado=%s WHERE idContacto=%s",
GetSQLValueString($_POST['Estado'], "text"),
GetSQLValueString($_POST['idContacto'], "int"));
mysql_select_db($database_treboles, $treboles);
$Result1 = mysql_query($updateSQL, $treboles) or die(mysql_error());
$updateGoTo = "consultas.php";
if (isset($_SERVER['QUERY_STRING'])) {
$updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
$updateGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $updateGoTo));
}
$editar_JuegoDeRegistro = "0";
if (isset($_GET["editar"])) {
$editar_JuegoDeRegistro = $_GET["editar"];
}
mysql_select_db($database_treboles, $treboles);
$query_JuegoDeRegistro = sprintf("SELECT * FROM contacto WHERE contacto.idContacto = %s", GetSQLValueString($editar_JuegoDeRegistro, "int"));
$JuegoDeRegistro = mysql_query($query_JuegoDeRegistro, $treboles) or die(mysql_error());
$row_JuegoDeRegistro = mysql_fetch_assoc($JuegoDeRegistro);
$totalRows_JuegoDeRegistro = mysql_num_rows($JuegoDeRegistro);?>En este caso la linea 49 corresponde al header location (La redireccion). Ya me fije bien que no posea espacios en blanco al inicio y cierre del php. Y nose que más hacer.
Esto es primera vez que me pasa, y solo courre en el hosting por que en local va como avion.