Ver Mensaje Individual
  #7 (permalink)  
Antiguo 21/11/2010, 22:55
Avatar de Sourcegeek
Sourcegeek
Colaborador
 
Fecha de Ingreso: mayo-2009
Ubicación: $mex['B.C.'];
Mensajes: 1.816
Antigüedad: 15 años
Puntos: 322
Respuesta: Warning: Cannot modify header information Me sale este error que puedo hac

Lo pusiste mal, te dije que al inicio y final del codigo respectivamente;
Código PHP:
<?php
ob_start
();
require_once(
'Connections/Activos3.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.
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 );
}
}
?>
<!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);
ob_end_flush();
?>
__________________
Buscas desarrollador web? Sourcegeek. Diseño web, Maquetación y Programación
¡Escribe bien! Esto es un foro, no un Facebook para que escribas con los pies