Foros del Web » Programando para Internet » PHP »

warning con sessiones ayuda

Estas en el tema de warning con sessiones ayuda en el foro de PHP en Foros del Web. hola amigos porque me sale este warning Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/profes5/public_html/sistemas/asistencia2/asistencia-docente-air.php:1) si aparentemente ...
  #1 (permalink)  
Antiguo 22/09/2008, 16:08
Avatar de vidalsoft  
Fecha de Ingreso: julio-2008
Ubicación: /www/...
Mensajes: 339
Antigüedad: 15 años, 8 meses
Puntos: 1
warning con sessiones ayuda

hola amigos porque me sale este warning
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/profes5/public_html/sistemas/asistencia2/asistencia-docente-air.php:1)
si aparentemente esta bien el script o como puedo ocultar el warning
..
tengo:
Código PHP:
<?php
session_start
();
include(
'correccionhora.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- saved from url=(0014)about:internet -->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Sistema De Asistenica - Professional AIR </title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="estilos.css" rel="stylesheet" type="text/css" />
<script src="prototype.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
function sf(){document.form1.txtCodigo.focus()}

function validar(e) {
    tecla = (document.all) ? e.keyCode : e.which; 
    if (tecla==8) return true; 
    patron =/\d/; //validando solo numeros
    te = String.fromCharCode(tecla); 
    if(document.form1.txtCodigo.value.length==8){
    document.form1.txtCodigo.value='';
    }
    return patron.test(te); 

</script>
</head>
<body bgcolor="#ffffff" onload="sf()">
  <?php
include('conexion.php');
$cod_personal=$_GET['personal'];
$conexion=abrir_conexion();
$fecha_hoy=gmdate("Y-m-j",time() + (3600 * (-5)) + $ajustesegundos);
$cad="Select distinct curso_docente.cod_personal  from personal,curso_docente,horario_curso where personal.cod_personal=curso_docente.cod_personal  and  curso_docente.cod_cursodocente=horario_curso.cod_cursodocente and cod_tipopersonal=2 and habilitado=1 and dia='$fecha_hoy'";

$result=mysql_query($cad,$conexion) or die("No se realizo la seleccion");    
while(
$row=mysql_fetch_array($result)){
    
$cod_profesor=$row['cod_personal'];
    
$cad="select cod_asistencia from asistencia_personal2 where cod_personal='$cod_profesor' and dia='$fecha_hoy'";
    
$result2=mysql_query($cad,$conexion) or die("No se realizo la seleccion");    
    if(!(
$row2=mysql_fetch_array($result2)))
    {    
        
$cad="select horario_curso.cod_horariocurso, horario_curso.hora_inicio, horario_curso.hora_fin from horario_curso , curso_docente where horario_curso.cod_cursodocente=curso_docente.cod_cursodocente and cod_personal='$cod_profesor' and horario_curso.dia='$fecha_hoy'  order by horario_curso.hora_inicio";
        
$resultclases=mysql_query($cad,$conexion);        
        while(
$rowclases=mysql_fetch_array($resultclases)){
            
$ini=$rowclases["hora_inicio"];
            
$fin=$rowclases["hora_fin"];
            
$cad="insert into asistencia_personal2 values('','$cod_profesor','','','$fecha_hoy','','',0,'','','',".session_is_registered('cod_usuario').",'','$ini','$fin')";
            
$resultinsertar=mysql_query($cad,$conexion) or die("No se realizo la insercion");
        }
    }
}
$cad="Select distinct dni, ap_paterno, ap_materno, nombre, personal.cod_personal from personal,curso_docente,horario_curso, asistencia_personal2 where personal.cod_personal=curso_docente.cod_personal  and  curso_docente.cod_cursodocente=horario_curso.cod_cursodocente and asistencia_personal2.cod_personal=personal.cod_personal and cod_tipopersonal=2 and habilitado=1 and horario_curso.dia='$fecha_hoy' order by 1";
$result=mysql_query($cad,$conexion) or die("No se realizo la consulta");
$row=mysql_fetch_array($result);
    
?>
<form name="form1" action="" method="">
<table width="772" border="0" align="center" cellpadding="0" cellspacing="0">
<!-- fwtable fwsrc="theme_sis.png" fwpage="Página 1" fwbase="index_.gif" fwstyle="Dreamweaver" fwdocid = "1550836876" fwnested="0" -->
  <tr>
   <td><img src="img/spacer.gif" width="18" height="1" border="0" alt="" /></td>
   <td><img src="img/spacer.gif" width="270" height="1" border="0" alt="" /></td>
   <td><img src="img/spacer.gif" width="109" height="1" border="0" alt="" /></td>
   <td><img src="img/spacer.gif" width="107" height="1" border="0" alt="" /></td>
   <td><img src="img/spacer.gif" width="36" height="1" border="0" alt="" /></td>
   <td><img src="img/spacer.gif" width="214" height="1" border="0" alt="" /></td>
   <td><img src="img/spacer.gif" width="18" height="1" border="0" alt="" /></td>
   <td><img src="img/spacer.gif" width="1" height="1" border="0" alt="" /></td>
  </tr>

  <tr>
   <td colspan="2"><img name="index__r1_c1" src="img/index__r1_c1.gif" width="288" height="36" border="0" id="index__r1_c1" alt="" /></td>
   <td colspan="3"><img name="index__r1_c3" src="img/index__r1_c3.gif" width="252" height="36" border="0" id="index__r1_c3" alt="" /></td>
   <td colspan="2"><img name="index__r1_c6" src="img/index__r1_c6.gif" width="232" height="36" border="0" id="index__r1_c6" alt="" /></td>
   <td><img src="img/spacer.gif" width="1" height="36" border="0" alt="" /></td>
  </tr>
  <tr>
       <td>&nbsp;</td>
       <td><span class="Estilo1">CODIGO :</span> 
         <input name="txtCodigo" type="text" class="Estilo3" id="txtCodigo" onkeypress="return validar(event)" size="15" maxlength="8"/>
         -
         
         <script type="text/javascript">
  new Form.Element.Observer('txtCodigo',1,function(element, value){
    new Ajax.Updater('resultados','recibe-asistencia-docente-entrada.php',{method:'get', parameters:'cod_profesor='+value})
        });
            
        </script>  
        <!-- <script type="text/javascript">
    new Form.Element.Observer('txtCodigo',1,function(element, value){
    new Ajax.Updater('foto','recibe-foto-docente-air.php',{method:'post', parameters:'v='+value})
        });
</script>   --> 
         <input name="txtCodigoSalida" type="text" class="Estilo3" id="txtCodigoSalida" onkeypress="return validar(event)" size="15" maxlength="8"/>
          <script type="text/javascript">
  new Form.Element.Observer('txtCodigoSalida',1,function(element, value){
    new Ajax.Updater('resultados','recibe-asistencia-docente-salida.php',{method:'get', parameters:'cod_profesor='+value})
        });
            
        </script>         </td>
     </tr>
     <tr>
       <td>&nbsp;</td>
       <td>&nbsp;</td>
     </tr>
     <tr>
       <td>&nbsp;</td>
       <td rowspan="12" valign="middle"><div id="resultados" class="Estilo2">
       
       </div>       </td>
     </tr>
     <tr>
       <td>&nbsp;</td>
       </tr>
     <tr>
       <td>&nbsp;</td>
       </tr>
     <tr>
       <td>&nbsp;</td>
       </tr>
     <tr>
       <td>&nbsp;</td>
       </tr>
     <tr>
       <td>&nbsp;</td>
       </tr>
     <tr>
       <td>&nbsp;</td>
       </tr>
     <tr>
       <td>&nbsp;</td>
       </tr>
     <tr>
       <td>&nbsp;</td>
       </tr>
     <tr>
       <td height="25">&nbsp;</td>
       </tr>
     <tr>
       <td>&nbsp;</td>
       </tr>
     <tr>
       <td height="32">&nbsp;</td>
       </tr>
     
     <tr>
       <td>&nbsp;</td>
       <td width="215" rowspan="4" valign="bottom"><?php include("menu-asistencia.php"); ?></td>
       </tr>
     <tr>
       <td>&nbsp;</td>
       </tr>
     <tr>
       <td>&nbsp;</td>
       </tr>
     <tr>
       <td>&nbsp;</td>
       </tr>
   </table></td>
   <td colspan="2" rowspan="2" valign="top" background="img/index__r4_c5.gif"><table width="250" border="0" cellspacing="0" cellpadding="0">
     <tr>
       <td>&nbsp;</td>
     </tr>
     <tr>
       <td align="center"><img src="img/seccion-fotografia.png" width="227" height="52" /></td>
     </tr>
     <tr>
       <td align="center"><div id="foto">
       </div></td>
     </tr>
     <tr>
       <td>&nbsp;</td>
     </tr>
     <tr>
       <td align="center">&nbsp;</td>
     </tr>
     <tr>
       <td align="center"></td>
     </tr>
   </table></td>
   <td><img name="index__r4_c7" src="img/index__r4_c7.gif" width="18" height="200" border="0" id="index__r4_c7" alt="" /></td>
   <td><img src="img/spacer.gif" width="1" height="200" border="0" alt="" /></td>
  </tr>
  <tr>
   <td rowspan="2"><img name="index__r5_c1" src="img/index__r5_c1.gif" width="18" height="214" border="0" id="index__r5_c1" alt="" /></td>
   <td rowspan="2"><img name="index__r5_c7" src="img/index__r5_c7.gif" width="18" height="214" border="0" id="index__r5_c7" alt="" /></td>
   <td><img src="img/spacer.gif" width="1" height="207" border="0" alt="" /></td>
  </tr>
  <tr>
   <td colspan="2"><img name="index__r6_c2" src="img/index__r6_c2.gif" width="379" height="7" border="0" id="index__r6_c2" alt="" /></td>
   <td colspan="3"><img name="index__r6_c4" src="img/index__r6_c4.gif" width="357" height="7" border="0" id="index__r6_c4" alt="" /></td>
   <td><img src="img/spacer.gif" width="1" height="7" border="0" alt="" /></td>
  </tr>
</table>
</form>
</body>
</html>
__________________
Anthony Vidal Contreras | @AnthonyVidalC | Skype: vidalsystem | [email protected]

Última edición por vidalsoft; 22/09/2008 a las 16:18
  #2 (permalink)  
Antiguo 22/09/2008, 16:30
Avatar de jam1138
/** @package Moderador */
 
Fecha de Ingreso: julio-2004
Ubicación: sèveR led onieR lE
Mensajes: 9.368
Antigüedad: 19 años, 8 meses
Puntos: 102
Respuesta: warning con sessiones ayuda

Será por tu editor. FAQ. http://www.forosdelweb.com/2023067-post176.html



Edit: Veo dicha FAQ habla de un editor hexadecimal ... no tendría que ser tan así, solo busca la opción en tu editor de no guardar el BOM y/o utiliza otro; para Windows una recomendación sería Notepad++.

__________________
٩(͡๏̯͡๏)۶
» Cómo hacer preguntas de manera inteligente «

"100 años después, la revolución no es con armas, es intelectual y digital"
  #3 (permalink)  
Antiguo 22/09/2008, 16:48
Avatar de vidalsoft  
Fecha de Ingreso: julio-2008
Ubicación: /www/...
Mensajes: 339
Antigüedad: 15 años, 8 meses
Puntos: 1
Respuesta: warning con sessiones ayuda

hola le cambien de esditor pero nada sigue igual..
ojo que en otras paginas tengo el mismo editor y funciona normal ...

Código PHP:
<?php
session_start
();
include(
'correccionhora.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- saved from url=(0014)about:internet -->
<html xmlns="http://www.w3.org/1999/xhtml">
__________________
Anthony Vidal Contreras | @AnthonyVidalC | Skype: vidalsystem | [email protected]
  #4 (permalink)  
Antiguo 22/09/2008, 16:51
Avatar de jam1138
/** @package Moderador */
 
Fecha de Ingreso: julio-2004
Ubicación: sèveR led onieR lE
Mensajes: 9.368
Antigüedad: 19 años, 8 meses
Puntos: 102
Respuesta: warning con sessiones ayuda

¿sí?, qué editor?, ¿te aseguraste no guardara el BOM?, ¿probaste con la FAQ? ... obviamente, no hay nada antes de session_start() ¿verdad? (se sobre-entendería).

__________________
٩(͡๏̯͡๏)۶
» Cómo hacer preguntas de manera inteligente «

"100 años después, la revolución no es con armas, es intelectual y digital"
  #5 (permalink)  
Antiguo 22/09/2008, 16:56
Avatar de vidalsoft  
Fecha de Ingreso: julio-2008
Ubicación: /www/...
Mensajes: 339
Antigüedad: 15 años, 8 meses
Puntos: 1
Respuesta: warning con sessiones ayuda

Hola , disculpa no entiendo sobre BOM que es..
__________________
Anthony Vidal Contreras | @AnthonyVidalC | Skype: vidalsystem | [email protected]
  #6 (permalink)  
Antiguo 22/09/2008, 17:07
Avatar de jam1138
/** @package Moderador */
 
Fecha de Ingreso: julio-2004
Ubicación: sèveR led onieR lE
Mensajes: 9.368
Antigüedad: 19 años, 8 meses
Puntos: 102
Respuesta: warning con sessiones ayuda

BOM o Byte Order Mark; a lo que se refiere la FAQ.
__________________
٩(͡๏̯͡๏)۶
» Cómo hacer preguntas de manera inteligente «

"100 años después, la revolución no es con armas, es intelectual y digital"
  #7 (permalink)  
Antiguo 22/09/2008, 18:08
 
Fecha de Ingreso: septiembre-2008
Mensajes: 25
Antigüedad: 15 años, 7 meses
Puntos: 1
Respuesta: warning con sessiones ayuda

como propagas el nombre de tu session??? por url o por cookies??? igual te está dando problemas eso...
aparte que yo pondría el include de correccionhora al final del código php, es decir, primero la conexión y todo eso y despues al final, antes de comenzar el código html pondría el correccionhora...
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 17:27.