Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\miniforo\conexion.php:12) in C:\xampp\htdocs\miniforo\validausuario.php on line 27
Código PHP:
<?
require('conexion.php');
session_start();
$usuario=$_POST['usuario'];
$contrasenia=$_POST['contrasenia'];
$sql="select * from usuario where usuario = '".$usuario."' and contrasenia = '".$contrasenia."' ";
$res=mysql_query($sql);
if (isset($_SESSION['ID']))
{
include('foroprincipal.php');
}
else {
if($linea= mysql_fetch_array($res) > 0 )
{
$_SESSION['ID']= $linea['id'];
$_SESSION['USER']= $linea['usuario'];
//$_SESSION['NOM']= $linea['nombre'];
//$_SESSION['APE']= $linea['apellido'];
//$_SESSION['TIPOUSUARIO']= $linea['tipou'];
include('foroprincipal.php');
}
else {
$host = $_SERVER['HTTP_HOST'];
$uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
$extra = 'index.php?modo=ingreso';
header("Location: http://$host$uri/$extra");
exit;
}
}
?>