Ver Mensaje Individual
  #1 (permalink)  
Antiguo 04/12/2008, 10:46
yanuarys
 
Fecha de Ingreso: noviembre-2008
Mensajes: 43
Antigüedad: 15 años, 5 meses
Puntos: 0
Funciones sesion y header

Hola estoy creando una nueva aplicacion en php y me da un error en la pagina de login el siguiente
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\wamp\www\contemplate\Paginas\login.php:1) in C:\wamp\www\contemplate\Paginas\clases.php on line 68.
Este es el codigo de la pagina login:

<?php
include("clases.php");
$temp=new Reportes();
$temp->AbrirSesion();

if(isset($_POST['usuario'])&& isset($_POST['contrasenna']))
{
include("clases.php");
$temp=new Reportes();
$temp->Connection('localhost','reportesphp','root','') ;
$result= $temp->RestringirAcceso($_POST['usuario'],$_POST['contrasenna']);
$cantidad=mysql_num_rows($result);
echo $cantidad;
//mysql_free_result($result);
//mysql_close();

if($cantidad>0){
$fila=mysql_fetch_row($result);
//$_SESSION['MM_Username'] = $fila[0];
//$GLOBALS['MM_Username'] = $fila[0];
//session_register("MM_Username");
//echo MM_Username;

//header ("location:RegistrarReporte.php");

}
/*else{
header("location:login.php");
}*/
}
?>
<!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=iso-8859-1" />
<link rel="stylesheet" href="../mm_training.css" type="text/css" />
<!-- TemplateBeginEditable name="doctitle" -->
<title>Documento sin t&iacute;tulo</title>
<!-- TemplateEndEditable -->
<style type="text/css">
<!--
.Estilo5 {color: #FFBA00}
-->
</style>
<!-- TemplateBeginEditable name="head" --><!-- TemplateEndEditable -->
</head>

<BODY BGCOLOR="#FFFFFF" text="#000000" link="#CCCCFF" vlink="#CCCCFF">
<table width="76%" border="0" cellpadding="0" cellspacing="0" bgcolor="#D3DCE6">
<tr>
<td width="221" height="53" valign="top"><IMG SRC="../images/index1x1.jpg" WIDTH=221 HEIGHT=53 BORDER=0></td>
<td width="162" height="53" valign="top"><IMG SRC="../images/index1x2.jpg" WIDTH=162 HEIGHT=53 BORDER=0></td>
<td width="119" height="53" valign="top"><IMG SRC="../images/index1x3.jpg" WIDTH=119 HEIGHT=53 BORDER=0></td>
<td width="16" height="53" valign="top"><IMG SRC="../images/index1x4.jpg" WIDTH=16 HEIGHT=53 BORDER=0 ALT="http://www.forosdelweb.com/images/index1x4.jpg"></td>
<td width="129" height="53" valign="top"><IMG SRC="../images/index1x5.jpg" WIDTH=129 HEIGHT=53 BORDER=0></td>
<td width="133" height="53" valign="top"><IMG SRC="../images/index1x6.jpg" WIDTH=133 HEIGHT=53 BORDER=0></td>
</tr>
<tr>
<td width="221" height="98" rowspan="2" valign="top"><IMG SRC="../images/index2x1.jpg" WIDTH=221 HEIGHT=98 BORDER=0></td>
<td width="162" height="98" rowspan="2" valign="top"><IMG SRC="../images/index2x2.jpg" WIDTH=162 HEIGHT=98 BORDER=0></td>
<td width="119" height="98" rowspan="2" valign="top"><IMG SRC="../images/index2x3.jpg" WIDTH=119 HEIGHT=98 BORDER=0></td>
<td width="16" height="98" rowspan="2" valign="top"><IMG SRC="../images/index2x4.jpg" WIDTH=16 HEIGHT=98 BORDER=0 ALT="http://www.forosdelweb.com/images/index2x4.jpg"></td>
<td width="129" height="57" valign="top"><IMG SRC="../images/index2x5.jpg" WIDTH=129 HEIGHT=57 BORDER=0></td>
<td width="133" height="57" valign="top"><img src="../images/index2x6.jpg" width=133 height=57 border=0></td>
</tr>
<tr>
<td width="129" height="41" valign="top"><IMG SRC="../images/index3x1.jpg" WIDTH=129 HEIGHT=41 BORDER=0></td>
<td width="133" height="41" valign="top"><IMG SRC="../images/index3x2.jpg" WIDTH=133 HEIGHT=41 BORDER=0></td>
</tr>
<tr>
<td width="502" height="4" colspan="3" valign="top"><IMG SRC="../images/autenf2.JPG" WIDTH=502 HEIGHT=4 BORDER=0 ALT="http://www.forosdelweb.com/images/index4x1.jpg"></td>
<td width="278" height="4" colspan="3" valign="top"><IMG SRC="../images/autenf2.JPG" WIDTH=278 HEIGHT=4 BORDER=0 ALT="http://www.forosdelweb.com/images/index4x2.jpg"></td>
</tr>
<tr>
<td width="502" height="20" colspan="3" valign="top" bgcolor="#26354A"><span class="Estilo5"><marquee behavior="scroll">
REPORTES SEISA
</marquee></span> </td>
<td width="278" height="20" colspan="3" valign="top" bgcolor="#26354A">&nbsp;</td>
</tr>
<tr>
<td width="780" height="4" colspan="6" valign="top" bgcolor="#FF6600"><IMG SRC="../images/autenf2.JPG" WIDTH=780 HEIGHT=4 BORDER=0 ALT="http://www.forosdelweb.com/images/index6x1.jpg"></td>
</tr>
<tr>
<td width="780" height="28" colspan="6" align="center" valign="top">&nbsp;</td>
</tr>
<tr>
<td width="221" height="4" valign="top"></td>
<td width="162" height="4" valign="top"></td>
<td width="119" height="4" valign="top"></td>
<td width="16" height="8" rowspan="2" valign="top">&nbsp;</td>
<td width="129" height="4" valign="top"></td>
<td width="133" height="4" valign="top"></td>
</tr>
<tr>
<td width="221" height="4" valign="top"></td>
<td width="162" height="4" valign="top"></td>
<td width="119" height="4" valign="top"></td>
<td width="262" height="279" colspan="2" rowspan="2" valign="top">&nbsp;</td>
</tr>
<tr>
<td width="502" height="275" colspan="3" valign="top"><!-- TemplateBeginEditable name="edtRegionAutenticacion" -->
<p></p>

<form ACTION="login.php" method="post" name="autenticarse" id="autenticarse" onsubmit="MM_validateForm('usuario','','R','contra senna','','R');return document.MM_returnValue">
<table width="26%" border="0" cellspacing="0" cellpadding="1" class="TitleColor">
<tr style="vertical-align: top">
<td><table width="26%" border="0" cellspacing="0" cellpadding="4">
<tr style="vertical-align: top">
<td width="20%" class="TitleColor"><label for="username"><strong>User Name</strong></label>
&nbsp;<br />
<input id="usuario" name="usuario" type="text" size="25" />
<p>&nbsp;</p>
<label for="password"><strong>Password</strong></label>
&nbsp;<br />
<input id="contrasenna" name="contrasenna" type="password" size="25" />
<p>
<input type="submit" name="ButtonName" value="Entrar" />
</p></td>
</tr>
</table></td>
</tr>
</table>
</form>
<p>&nbsp;</p>
<!-- TemplateEndEditable --> </td>
<td width="16" height="275" valign="top">&nbsp;</td>
</tr>
<tr>
<td height="30" colspan="3" valign="top">&nbsp;</td>
<td height="30" valign="top">&nbsp;</td>
<td height="30" colspan="2" valign="top">&nbsp;</td>
</tr>
<tr>
<td width="502" height="30" colspan="3" valign="top" bgcolor="#26354A"><p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p></td>
<td width="16" height="30" valign="top" bgcolor="#26354A">&nbsp;</td>
<td width="262" height="30" colspan="2" valign="top" bgcolor="#26354A">&nbsp;</td>
</tr>
<tr>
<td width="221" height="1" valign="top"><img width="221" height="1" src="../transparent.gif"></td>
<td width="162" height="1" valign="top"><img width="162" height="1" src="../transparent.gif"></td>
<td width="119" height="1" valign="top"><img width="119" height="1" src="../transparent.gif"></td>
<td width="16" height="1" valign="top"><img width="16" height="1" src="../transparent.gif"></td>
<td width="129" height="1" valign="top"><img width="129" height="1" src="../transparent.gif"></td>
<td width="133" height="1" valign="top"><img width="133" height="1" src="../transparent.gif"></td>
</tr>
</table>
</BODY>
</html>

y este el de la pagina donde diseñare las clase:

<?php

/*
* class «class»
*/
/*
* class «class»
*/

class Reportes {

/*
* function «name»
* @param $«arg»
*/
var $link;
function __construct()
{
//this->$link;
}
function MostrarMensaje() {

echo 'Esto es una prueba';
}
/*
* function «name»
* @param $«arg»
*/

function Connection($server,$db,$username,$password)
{
$this->link= mysql_connect($server,$username,$password) or trigger_error(mysql_error(),E_USER_ERROR);
mysql_select_db($db,$this->link);
// var_dump($this->link);

/*if (!$this->link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';*/



}

function InsertarReporte($fecha_inicio,$hora_inicio, $id_estado,$id_prioridad,$id_sucursal,$descripcion ,$nombre_cliente,$cargo,$id_servicio)
{


$query="Insert into t_reporte (fecha_inicio,hora_inicio,nombre_cliente,descripci on,cargo,id_sucursal,id_prioridad,id_estado,id_ser vicio)values('$fecha_inicio','$hora_inicio','$nomb re_cliente','$descripcion','$cargo','$id_sucursal' ,'$id_prioridad','$id_estado','$id_servicio')";
//var_dump($this->link);
mysql_query($query,$this->link);
mysql_close();

}

function RestringirAcceso($usuario,$contrasenna) {

$query="SELECT usuario, contrasenna FROM t_usuario WHERE usuario='$usuario' AND contrasenna='$contrasenna'";
$result= mysql_query($query,$this->link);
//$cant=mysql_num_rows($result);
//mysql_free_result($result);
//mysql_close();
return $result;
}

function AbrirSesion() {
//if (!isset($_SESSION))
session_start();
}

}
?>

Por favor me urge que alguien me ayude.