Ver Mensaje Individual
  #1 (permalink)  
Antiguo 14/07/2009, 09:41
quevon24
 
Fecha de Ingreso: junio-2006
Mensajes: 83
Antigüedad: 17 años, 11 meses
Puntos: 0
Ayuda: Warning: session_start()

Hola amigos, me decidi a hacer un sistema de registro deusuarios con dreamweaver, y lo subi a mi servidor para probarlo, y cuando me logeo , y me desconecto todo bien.

Pero al momento de intnetar logearme por seguna ves pues cargo bien el menu de los usuarios, pero me aparecio este error:

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home2/oviedosc/public_html/web/SU/mensuario.php:2) in /home2/oviedosc/public_html/web/SU/mensuario.php on line 4

Este es mi archivo:

Código PHP:

<?php
//initialize the session
session_start();

// ** Logout the current user. **
$logoutAction $_SERVER['PHP_SELF']."?doLogout=true";
if ((isset(
$_SERVER['QUERY_STRING'])) && ($_SERVER['QUERY_STRING'] != "")){
  
$logoutAction .="&"htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset(
$_GET['doLogout'])) &&($_GET['doLogout']=="true")){
  
//to fully log out a visitor we need to clear the session varialbles
  
session_unregister('MM_Username');
  
session_unregister('MM_UserGroup');
    
  
$logoutGoTo "desconectado.php";
  if (
$logoutGoTo) {
    
header("Location: $logoutGoTo");
    exit;
  }
}
?>
<?php
session_start
();
$MM_authorizedUsers "";
$MM_donotCheckaccess "true";

// *** Restrict Access To Page: Grant or deny access to this page
function isAuthorized($strUsers$strGroups$UserName$UserGroup) { 
  
// For security, start by assuming the visitor is NOT authorized. 
  
$isValid False

  
// When a visitor has logged into this site, the Session variable MM_Username set equal to their username. 
  // Therefore, we know that a user is NOT logged in if that Session variable is blank. 
  
if (!empty($UserName)) { 
    
// Besides being logged in, you may restrict access to only certain users based on an ID established when they login. 
    // Parse the strings into arrays. 
    
$arrUsers Explode(","$strUsers); 
    
$arrGroups Explode(","$strGroups); 
    if (
in_array($UserName$arrUsers)) { 
      
$isValid true
    } 
    
// Or, you may restrict access to only certain users based on their username. 
    
if (in_array($UserGroup$arrGroups)) { 
      
$isValid true
    } 
    if ((
$strUsers == "") && true) { 
      
$isValid true
    } 
  } 
  return 
$isValid
}

$MM_restrictGoTo "error_1.php";
if (!((isset(
$_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers$_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {   
  
$MM_qsChar "?";
  
$MM_referrer $_SERVER['PHP_SELF'];
  if (
strpos($MM_restrictGoTo"?")) $MM_qsChar "&";
  if (isset(
$QUERY_STRING) && strlen($QUERY_STRING) > 0
  
$MM_referrer .= "?" $QUERY_STRING;
  
$MM_restrictGoTo $MM_restrictGoTo$MM_qsChar "accesscheck=" urlencode($MM_referrer);
  
header("Location: "$MM_restrictGoTo); 
  exit;
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<!-- Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=1,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=700,left = 262,top = 34');");
}
// End -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Documento sin t&iacute;tulo</title>
<style type="text/css">
<!--
.Estilo1 {
    font-family: "Monotype Corsiva";
    font-weight: bold;
    font-size: 24px;
}
.Estilo2 {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 16px;
}
.Estilo3 {font-family: Verdana, Arial, Helvetica, sans-serif}
-->
</style>
</head>

<body>
<p align="center" class="Estilo1"><img src="post-it.jpg" width="64" height="64"><span class="Estilo2">Menu de Ex-Alumnos </span></p>
<table width="306" border="0" align="center">
  <tr>
    <td><a href="javascript:popUp('usuarios_galeria.php')" class="Estilo3">Ver Fotos de usuarios </a></td>
  </tr>
  <tr>
    <td width="300"><span class="Estilo3"><a href="javascript:popUp('usuarios_registrados.php')">Ver usuarios registrados</a></span></td>
  </tr>
  <tr>
    <td><a href="javascript:popUp('subir_imagen.php')" class="Estilo3">Enviar Fotos </a></td>
  </tr>
  <tr>
    <td><a href="<?php echo $logoutAction ?>" class="Estilo3">Desconectar</a></td>
  </tr>
  <tr>
    <td>
        </td>
  </tr>
</table>

</body>
</html>