Ver Mensaje Individual
  #7 (permalink)  
Antiguo 24/05/2011, 17:40
deywibkiss
 
Fecha de Ingreso: mayo-2011
Mensajes: 105
Antigüedad: 13 años
Puntos: 3
Respuesta: Logica en Sesiones de usuario

Cita:
Iniciado por jotaincubus Ver Mensaje
sip HTML-PHP-JAVASCRIPT o lo que sea, hasta un espacio puede hacer que se te genere ese error, debes colocar session_start(); en la linea numero 1 de las paginas.


haber si entendi lo de los espacios porque yo le quite todo los espacios a mi html y sigue saliendo el error.

este es mi html con el codigo php al inicio:

Código HTML:
<?php session_start(); ?>
<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//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"/>
<script language="javascript">
//Su explorador nosoportajavaolotienedeshabilitado;estapaginanecesitajavascriptparafuncionarcorrectamente !-->
function pop(pagina,ventana,parametros){
window.open(pagina,ventana,parametros);
}
function abrir(direccion,pantallacompleta,herramientas,direcciones,estado,barramenu,barrascroll,cambiatamano,ancho,alto,izquierda,arriba,sustituir)
{
var opciones="fullscreen="+pantallacompleta+
",toolbar="+herramientas+
",location="+direcciones+
",status="+estado+
",menubar="+barramenu+
",scrollbars="+barrascroll+
",resizable="+cambiatamano+
",width="+ancho+
",height="+alto+
",left="+izquierda+
",top="+arriba;
var ventana=window.open(direccion,"venta",opciones,sustituir);
}
function abrircrearcuenta(){
document.location.href='crearusuario.php';
}
//--></script>
<meta http-equiv="Content-Type"
content="text/html;charset=iso-8859-1">
<meta name="description"
content="Instituci&oacute;ndeeducaci&oacute;nsuperior.Unadelasm&aacute;sreconocidasdeColombiayLatinoam&eacute;rica.">
<meta name="keywords"
content="univalle,carreras,ciencia,tecnolog&iacute;a,cultura,academia,pregrados,diplomados">
<meta name="Identifier-URL"content="">
<meta content="es"name="content-language">
<meta http-equiv="pragma"content="no-cache">
<meta http-equiv="Cache-Control"content="no-cache">
<title>UniversidaddelValle,SedeYumbo-Colombia</title>
<style type="text/css"media="screen">@import"hoja.css";</style>
<link href="../css/hoja.css"rel="stylesheet"type="text/css">
</head>
<body>
<form name="forminiciosesion"action="eventoiniciarsesion.php"method="POST">
<!--tablacajonrojo-->
<table border="0"width="100%">
<!--inicioiniciarsesion-->
<tr>
<td style="border-width:1px;">
<table border="0" bordercolor= "pink" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr bgcolor="#cc0000">
<td colspan="2" height="18" nowrap><font color="#ffffff"face="Arial,Helvetica,sans-serif" size="1"><strong></strong></font>
<div align="left"><font color="#ffffff" face="Arial,Helvetica,sans-serif" size="2"><strong>INICIAR SESION
</strong></font></div>
</td>
</tr>
<br>
<tr>
<td align="center">
<br>
<b>
<table border="0">
<tr>
<td>
<img src="http://www.forosdelweb.com/f18/metaforas/warning.png" width="30" height="30"/>
</td>
<td valign="middle">
<font face="Arial,Helvetica,sans-serif"size="2"color="#CC0000"><b>IMPORTANTE: </b></font><font face="Arial,Helvetica,sans-serif" size="2"<b>Inicie sesi&oacuten si ya dispone de una cuenta activada.</b></font>
</td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<!--panellogin-->
<tr>
<td align="center" style="border-width:0px;">
<br>
<br>
<table bgcolor="#F8E1E1" cellspacing="20" border="1" width="80%">
<tr>
<td style="border-width:0px;">
<table>
<tr>
<td align="center" colspan="3">
<font face="Arial,Helvetica,sans-serif" size="2"><b>Identif&iacutequese Aqu&iacute. Ingrese su alias y contraseña.</b></font>
<br>
<br>
</td>
</tr>
<tr>
<td rowspan="2"><img src="http://www.forosdelweb.com/f18/metaforas/llave.png" width="64" height="64"></td>
<td align="right"><font face="Arial,Helvetica,sans-serif" size="2"><b>Alias:</font></td>
<td><input type="text" name="alias" maxlength="30" size="30"></td>
</tr>
<tr>
<td align="right"><font face="Arial,Helvetica,sans-serif" size="2"><b>Contraseña:</font></td>
<td><input type="password" name="contrasena" maxlength="20" size="20"></td>
</tr>
<td colspan="3" align="center"><input type="submit" name="ingresar" value="IniciarSesión"></td>
<tr>
<td colspan="3" align="center"><a href=olvidoclave.php>¿Olvid&oacute su clave?</a></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<!--paneliranuevacuenta-->
<tr>
<td align="center" style="border-width:0px;">
<br>
<table bgcolor="#F8E1E1" cellspacing="20" border="2" width="80%">
<tr>
<td align="center" style="border-width:0px;"><font face="Arial,Helvetica,sans-serif"size="2"><b>¿Eresnuevo? Reg&iacutestrate. </b></font>
</td>
</tr>
<tr>
<td align="center" style="border-width:0px;"><input type="button" name="crearcuenta" onclick="abrircrearcuenta()" value="CrearCuenta"></td>
</tr>
</table>
</td>
</tr>
</table>
</form>>
</body>
</html> 

como debe quedar entonces?

otra pregunta: como se registran las variables? session_register?