Foros del Web » Programando para Internet » PHP »

Error en php

Estas en el tema de Error en php en el foro de PHP en Foros del Web. Gente toy tratando de actualizar una page y me tira este error: Warning: Cannot modify header information - headers already sent by (output started at ...
  #1 (permalink)  
Antiguo 03/11/2008, 07:06
 
Fecha de Ingreso: agosto-2008
Mensajes: 97
Antigüedad: 15 años, 7 meses
Puntos: 1
Error en php

Gente toy tratando de actualizar una page y me tira este error:

Warning: Cannot modify header information - headers already sent by (output started at C:\wamp\www\discoteam\updatelist.php:1) in C:\wamp\www\discoteam\updatelist.php on line 73

Si alguien tiene alguna solucion Mil gracias!

Cita:
<?php virtual('/discoteam/Connections/connAudit.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;
}

$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 tbl_planillabase2 SET Ecckt=%s, TelcoID=%s, ICSC=%s, ProvSys=%s, Cost=%s, CktID=%s, Ban=%s, FoundCktID=%s, CFA=%s, AccionSorter=%s, Comments=%s, NMT=%s, Cameo=%s, ICSC2=%s, location=%s, Explanation=%s, Customer=%s, ACTL=%s, ACNA=%s, ReqType=%s, OutOrder=%s, DummyOrder=%s, Orderdate=%s, CommentsToASR=%s, NFO=%s, city=%s, `state`=%s, Aduitor=%s WHERE id=%s",
GetSQLValueString($_POST['Ecckt'], "text"),
GetSQLValueString($_POST['TelcoID'], "text"),
GetSQLValueString($_POST['ICSC'], "text"),
GetSQLValueString($_POST['ProvSys'], "text"),
GetSQLValueString($_POST['Cost'], "text"),
GetSQLValueString($_POST['CktID'], "text"),
GetSQLValueString($_POST['Ban'], "text"),
GetSQLValueString($_POST['FoundCktID'], "text"),
GetSQLValueString($_POST['CFA'], "text"),
GetSQLValueString($_POST['AccionSorter'], "text"),
GetSQLValueString($_POST['Comments'], "text"),
GetSQLValueString($_POST['NMT'], "text"),
GetSQLValueString($_POST['Cameo'], "text"),
GetSQLValueString($_POST['ICSC2'], "text"),
GetSQLValueString($_POST['location'], "text"),
GetSQLValueString($_POST['Explanation'], "text"),
GetSQLValueString($_POST['Customer'], "text"),
GetSQLValueString($_POST['ACTL'], "text"),
GetSQLValueString($_POST['ACNA'], "text"),
GetSQLValueString($_POST['ReqType'], "text"),
GetSQLValueString($_POST['OutOrder'], "text"),
GetSQLValueString($_POST['DummyOrder'], "text"),
GetSQLValueString($_POST['Orderdate'], "text"),
GetSQLValueString($_POST['CommentsToASR'], "text"),
GetSQLValueString($_POST['NFO'], "text"),
GetSQLValueString($_POST['city'], "text"),
GetSQLValueString($_POST['state'], "text"),
GetSQLValueString($_POST['Aduitor'], "text"),
GetSQLValueString($_POST['id'], "int"));

mysql_select_db($database_connAudit, $connAudit);
$Result1 = mysql_query($updateSQL, $connAudit) or die(mysql_error());

$updateGoTo = "main.php";
if (isset($_SERVER['QUERY_STRING'])) {
$updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
$updateGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $updateGoTo));}

$colname_rs_actualizar = "-1";
if (isset($_GET['recordID'])) {
$colname_rs_actualizar = (get_magic_quotes_gpc()) ? $_GET['recordID'] : addslashes($_GET['recordID']);
}
mysql_select_db($database_connAudit, $connAudit);
$query_rs_actualizar = sprintf("SELECT * FROM tbl_planillabase2 Where id = %s", $colname_rs_actualizar);
$rs_actualizar = mysql_query($query_rs_actualizar, $connAudit) or die(mysql_error());
$row_rs_actualizar = mysql_fetch_assoc($rs_actualizar);
$totalRows_rs_actualizar = mysql_num_rows($rs_actualizar);
?>

Última edición por Chelo1982; 03/11/2008 a las 07:15
  #2 (permalink)  
Antiguo 03/11/2008, 07:09
 
Fecha de Ingreso: noviembre-2002
Mensajes: 1.341
Antigüedad: 21 años, 4 meses
Puntos: 17
Respuesta: Error en php

Estaría bien ver el código... pero basicamente ha habido salida HTML antes de iniciar sesión, hacer un redireccionamiento con header, etc....
  #3 (permalink)  
Antiguo 03/11/2008, 07:26
Avatar de chitoso  
Fecha de Ingreso: mayo-2008
Ubicación: Montevideo, Uruguay
Mensajes: 205
Antigüedad: 15 años, 10 meses
Puntos: 5
Respuesta: Error en php

Estas imprimiendo información en pantalla antes de enviar los headers. Es un error muy comun y hay información aqui mismo en el foro.
__________________
Pasión por la Música
  #4 (permalink)  
Antiguo 03/11/2008, 07:29
Avatar de eulloa  
Fecha de Ingreso: octubre-2007
Ubicación: Donde caiga la noche, si mi hijo me deja
Mensajes: 691
Antigüedad: 16 años, 5 meses
Puntos: 5
Respuesta: Error en php

Lo mismo q te dice Keysher, reviza si hay cualquier salida antes del header q usas, aunq sea un espacio en blanco
salu2
  #5 (permalink)  
Antiguo 03/11/2008, 07:33
 
Fecha de Ingreso: noviembre-2002
Mensajes: 1.341
Antigüedad: 21 años, 4 meses
Puntos: 17
Respuesta: Error en php

Supongo que la línea en cestión será esta:

header(sprintf("Location: %s", $updateGoTo));}

Asegurate de que antes de eso no se imprime nada por pantalla (que parece que no es así). Mira también el fichero connAudit.php para asegurarte de que no se imprime nada. Es importante que no haya nada en blanco antes de la etiqueta de apertura de PHP <?

Por cierto, la próxima vez cuando añadas el código no edites el post, genera una respuesta, ya que sino no nos enteramos!
  #6 (permalink)  
Antiguo 03/11/2008, 07:52
 
Fecha de Ingreso: agosto-2008
Mensajes: 97
Antigüedad: 15 años, 7 meses
Puntos: 1
Respuesta: Error en php

Gracias Keysher! voy a probar q onda la verdad me ta volviendo loco! y sorry por la ediccion del post!
  #7 (permalink)  
Antiguo 03/11/2008, 08:02
 
Fecha de Ingreso: agosto-2008
Mensajes: 97
Antigüedad: 15 años, 7 meses
Puntos: 1
Respuesta: Error en php

Ya gente lo pude solucionar cambie el codigo de la linea 1 y listo gracias a todos por su tiempo ! y por responder!
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 16:45.