"Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/sidarco/public_html/intranet/cover/header.php:4) in /home/sidarco/public_html/intranet/sec/inicio.php on line 37"
he leido por hay varias soluciones pero no doy con la respuesta
mi pagina web la estoy haciendo modular por lo que el index lo tengo de la siguiente forma:
Código:
el error lo arroja inicio.php aca les coloco el codigo:<?php ?> <?php include("cover/header.php"); ?> <div id="marco"> <div id="header"> <div id="logo"> <div id="menu"><?php include("modulos/mod_menu/menu.php"); ?> </div> </div> </div> <div id="contenido"> <div id="sidebar"><?php include("cover/sidebar.php"); ?></div> <div id="conten"><?php include("cover/sistem.php"); ?></div> </div> <div id="footframe"> <div id="time"><div class="style23"><?php include("modulos/mod_reloj/reloj.php"); ?></div></div> <div id="footer"><?php include("modulos/mod_derautor/derechoautor.php"); ?></div> </div> </div> <?php include("cover/footer.php"); ?>
Código:
bien sabria agradecer que me ayudaran a encontrar el problema <?php require_once('Connections/config.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_config, $config); $query_Recordset1 = "SELECT * FROM ft_usuarios"; $Recordset1 = mysql_query($query_Recordset1, $config) or die(mysql_error()); $row_Recordset1 = mysql_fetch_assoc($Recordset1); $totalRows_Recordset1 = mysql_num_rows($Recordset1); $colname_Recordset2 = "-1"; if (isset($_SESSION['MM_username'])) { $colname_Recordset2 = $_SESSION['MM_username']; } mysql_select_db($database_config, $config); $query_Recordset2 = sprintf("SELECT usuario FROM ft_usuarios WHERE usuario = %s", GetSQLValueString($colname_Recordset2, "text")); $Recordset2 = mysql_query($query_Recordset2, $config) or die(mysql_error()); $row_Recordset2 = mysql_fetch_assoc($Recordset2); $totalRows_Recordset2 = mysql_num_rows($Recordset2); ?> <?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['pass']; $MM_fldUserAuthorization = ""; $MM_redirectLoginSuccess = "index.php?seccion=welcome"; $MM_redirectLoginFailed = "index.php?seccion=falleuser"; $MM_redirecttoReferrer = false; mysql_select_db($database_config, $config); $LoginRS__query=sprintf("SELECT usuario, pass FROM ft_usuarios WHERE usuario=%s AND pass=%s", GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text")); $LoginRS = mysql_query($LoginRS__query, $config) or die(mysql_error()); $loginFoundUser = mysql_num_rows($LoginRS); if ($loginFoundUser) { $loginStrGroup = ""; //declare two session variables and assign them $_SESSION['MM_Username'] = $loginUsername; $_SESSION['MM_UserGroup'] = $loginStrGroup; if (isset($_SESSION['PrevUrl']) && false) { $MM_redirectLoginSuccess = $_SESSION['PrevUrl']; } header("Location: " . $MM_redirectLoginSuccess ); } else { header("Location: ". $MM_redirectLoginFailed ); } } ?> <div id="content-box"> <div class="padding"> <div class="login" id="element-box"> <div class="t"> <div class="t"> <div class="t"></div> </div> </div> <div class="m"> <h1>Ingreso de Usuarios Registrados</h1> <div id="section-box"> <div class="t"> <div class="t"> <div class="t"></div> </div> </div> <div class="m"> <form ACTION="<?php echo $loginFormAction; ?>" style="clear: both;" id="form-login" name="login" method="POST"> <p id="form-login-username"> <label for="modlgn_username">Usuario</label> <input type="text" size="15" class="inputbox" id="modlgn_username" name="usuario"> </p> <p id="form-login-password"> <label for="modlgn_passwd">Contraseña</label> <input type="password" size="15" class="inputbox" id="modlgn_passwd" name="pass"> </p> <p style="clear: both;" id="form-login-lang"> <div class="button_holder"> <div class="button1"> <div class="next"> <a onclick="login.submit();"> Entrar</a> </div> </div> </div> <div class="clr"></div> <input type="submit" value="Entrar" style="border: 0; padding: 0; margin: 0; width: 0px; height: 0px;"> </form> <div class="clr"></div> </div> <div class="b"> <div class="b"> <div class="b"></div> </div> </div> </div> <p>Ingresa un nombre de usuario y contraseña validos para acceder al Sistema.</p> <p> <a href="javascript:history.back(1)">Regresar a la Pagina Anterior</a> </p> <div id="lock"></div> <div class="clr"></div> </div> <div class="h_green" id="border-top"> <div> <div> <div class="adminform">Insurance Broker Sistem By ARTEM LABS, CA</div> </div> </div> </div> <div class="b"> <div class="b"> <div class="b"></div> </div> </div> </div> <div class="clr"></div> </div> </div> <div id="border-bottom"><div><div></div></div> </div> </body><?php mysql_free_result($Recordset1); mysql_free_result($Recordset2); ?>