Ver Mensaje Individual
  #6 (permalink)  
Antiguo 21/11/2010, 22:32
dj_ferdinand
 
Fecha de Ingreso: noviembre-2010
Mensajes: 6
Antigüedad: 13 años, 5 meses
Puntos: 0
Respuesta: Warning: Cannot modify header information Me sale este error que puedo hac

Cita:
Iniciado por Sourcegeek Ver Mensaje
Pon ob_start(); al inicio de tu codigo y ob_end_flush(); al final..

Saludos!
Lo intente y me mando el siguiente error:

Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\index.php:1) in C:\xampp\htdocs\index.php on line 79

Agrego todo el index para que pueda ver mis lineas de codigo:

<?php require_once('Connections/Activos3.php'); ?>
<?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;
}
}

mysql_select_db($database_Activos3, $Activos3);
$query_Activos_Login_Usuario = "SELECT * FROM usuarios ORDER BY nivel ASC";
$Activos_Login_Usuario = mysql_query($query_Activos_Login_Usuario, $Activos3) or die(mysql_error());
$row_Activos_Login_Usuario = mysql_fetch_assoc($Activos_Login_Usuario);
$totalRows_Activos_Login_Usuario = mysql_num_rows($Activos_Login_Usuario);
?>
<?php
// *** Validate request to login to this site.
ob_start();
if (!isset($_SESSION)) {
@session_start();
}

$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($_GET['accesscheck'])) {
$_SESSION['PrevUrl'] = $_GET['accesscheck'];
}

if (isset($_POST['usuario'])) {
$loginUsername=$_POST['usuario'];
$password=$_POST['password'];
$MM_fldUserAuthorization = "nivel";
$MM_redirectLoginSuccess = "Administrador/inicio.php";
$MM_redirectLoginSuccess2 = "Consulta/inicio.php";
$MM_redirectLoginSuccess3 = "Supervisor/inicio.php";
$MM_redirectLoginFailed = "index.php";
$MM_redirecttoReferrer = false;
mysql_select_db($database_Activos3, $Activos3);

$LoginRS__query=sprintf("SELECT usuario, clave, nivel FROM usuarios WHERE usuario=%s AND clave=%s",
GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));

$LoginRS = mysql_query($LoginRS__query, $Activos3) or die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);
if ($loginFoundUser) {

$loginStrGroup = mysql_result($LoginRS,0,'nivel');

//declare two session variables and assign them
$_SESSION['MM_Username'] = $loginUsername;
$_SESSION['MM_UserGroup'] = $loginStrGroup;

if (isset($_SESSION['PrevUrl']) && false) {
$MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
}
if($loginStrGroup==1) { header("Location: " . $MM_redirectLoginSuccess ); }
if($loginStrGroup==2) { header("Location: " . $MM_redirectLoginSuccess2 ); }
if($loginStrGroup==3) { header("Location: " . $MM_redirectLoginSuccess3 ); }
}
else {
header("Location: ". $MM_redirectLoginFailed );
}
}
ob_end_flush();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Sistema de Inventario</title>
<link href="CSS/estilo.css" rel="stylesheet" type="text/css" />
<script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
<script src="JS/validacion.js" type="text/javascript"></script>
<link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="contenedor">
<div id="cabecera"><center><img src="Imagenes/Titulo3.PNG" alt="Sistema de Inventario" border="0" class="imagen"></center></div>
<h1>Sistema de Inventario</h1>
<div id="login">
<h2>Ingreso de Usuario</h2>
<form ACTION="<?php echo $loginFormAction; ?>" METHOD="POST" name="ingreso" id="ingreso">
<table width="234" border="0" align="center">
<tr>
<td width="77" class="inserta_tablas1"><strong>Usuario:</strong></td>
<td width="147">
<input type="text" name="usuario" id="usuario" />

</tr>
<tr>
<td class="inserta_tablas1"><strong>Contraseña:</strong></td>
<td>
<input type="password" name="password" id="password" />

</tr>
<tr>
<td class="inserta_tablas1">&nbsp;</td>
<td><label>
<input type="submit" name="button" id="button" value="Enviar" class="boton" onclick="return Ingreso();"/>
<input type="reset" name="button2" id="button2" value="Restablecer" />
</label></td>
</tr>
</table>
</form>
</div>
<div id="pie">
<center>
<p>&nbsp;</p>
<p>Sistema de Inventario Realizado por Europea System</a></p>
</center>
</div>
</div>
</body>
</html>
<?php
mysql_free_result($Activos_Login_Usuario);
?>


Ojala me puedan ayudar tengo 3 semanas parado con esto Se los agradeceria mucho

Última edición por dj_ferdinand; 21/11/2010 a las 22:42