empezando un form de inicio de sesion
haber chekenme porke me manda tantos errores este codigo..
errores:
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/turismores/domains/turismoresidencial.com.mx/public_html/sesion.php:7) in /home/turismores/domains/turismoresidencial.com.mx/public_html/sesion.php on line 24
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/turismores/domains/turismoresidencial.com.mx/public_html/sesion.php:7) in
codigo:
<html>
<head>
<title>inicio de sesion</title>
<meta http-equiv="" content="text/html; charset=iso-8859-1">
<meta http-equiv="" content="text/html; charset=iso-8859-1">
<?php
include("conexion.php");
$email = $_POST["email"];
$password= $_POST["password"];
$from="
[email protected]";
$query = "SELECT * from cliente WHERE mail='{$email}' and pswd='{$password}'";
$res=mysql_query($query);
$datos=mysql_fetch_array($res);
$query2 = "SELECT * from cliente WHERE mail='{$email}'";
$res2=mysql_query($query2);
$datos2=mysql_fetch_array($res2);
if ($iniciar)
{
if($datos[0]!=NULL)
{
session_start();
$_SESSION['usuario']=$_POST['mail'];
}
else
{
echo "<form method='post' action='sesion.php'>";
echo "NOMBRE DE USUARIO O CONTRASEÑA INCORRECTA \n";
echo "\n";
echo "DESEA QUE REENVIEMOS TU CONTRASEÑA DE ACCESO A ESTE MAIL : ";
$email=$email;
echo $email;
echo "\n\n";
echo "<input name='email' type='hidden' value='$email'>";
echo "<input type='submit' name='enviar' value='Enviar'>";
echo "<input name='button' type='button' onclick='window.close();' value='Cerrar esta ventana' />";
echo "<input name='button' type='button' onclick='javascript
:regresar();' value='REGRESAR A FORMULARIO' />";
echo "</form>";
}
}//CIERRE DEL IF INICAR SESIÓN
else
{
if($enviar) {
$mensaje = "Datos de registro:\n";
$mensaje .= "E-MAIL: " . $datos2[0] . "\n";
$mensaje .= "CONTRASEÑA: " . $datos2[1] . "\n";
$mensaje .= "PAÍS: " . $datos2[2] . "\n";
mail($datos2[0],"Datos de Registro en Turismo Residencial de México",$mensaje,"From: $from <$from>") ;
echo "El email ha sido enviado con éxito." ;
echo $datos2[0];
echo "\n";
echo "<input name='button' type='button' onclick='window.close();' value='Cerrar esta ventana' />";
}
}
?>
<script lenguage="JavaScript">
function regresar()
{
history.back();
}
</script>
</head>
<body>
<?PHP
if ((!$iniciar)&&(!$enviar))
{
echo "<p>Inicia sesión para guardar tus propiedades favoritas, recibir ofertas y un boletín mensual.<br>";
echo"Si aún no te has registrado en TURISMO RESIDENCIAL has <a href='registrar.php'>click aquí</a></p>";
echo "<p>";
echo "<form onsubmit='return validacion(this) && validar(this)' action='sesion.php' method='post' >";
echo "<p>email:
<input type='text' name='email'>
<br>
password:
<input type='password' name='password'></p>
</p>
<p><input type='submit' name='iniciar' value='INICIAR'></p>";
echo "</form>";
}
?>
</body>
</html>
ayuda porfis