Ver Mensaje Individual
  #15 (permalink)  
Antiguo 23/05/2011, 12:12
Avatar de apolazo
apolazo
 
Fecha de Ingreso: mayo-2011
Ubicación: Cabrero
Mensajes: 118
Antigüedad: 13 años, 9 meses
Puntos: 2
Respuesta: Sistema de Evaluacion

Código PHP:
<?php 
include("funciones.php"); 
$conexion=coneccion();

if ( 
$_POST["run"] && $_POST["contrasena"] )
    {
    
$sql="SELECT * FROM profesor WHERE RUN='".$_POST["run"]."'";

    
$resultado=mysql_query($sql,$conexion);
    
$datos=mysql_fetch_array($resultado);

    if (
$datos["CONTRASENA"]==$_POST["contrasena"] && $datos["CONTRASENA"]==$_POST["contrasena"])
        {
        
session_destroy();
        
session_start();
        
        
$_SESSION["RUN"]=$datos["RUN"];
         
$_SESSION["CONTRASENA"]=$datos["CONTRASENA"];
        
echo 
$sql."  ".mysql_error();
        
header ("Location: inicio_profesores.php");
        }
    else
        {
        
$n1="Error RUN y/o Contrasena son incorrectos";
        
header("Location: index.php?n1=$n1");
        }
    }
else 
    {
    
$n1="Error Usuario y/o Contrasena son incorrectos";
    
header("Location: index.php?n1=$n1");
    }

echo 
$sql."  ".mysql_error();


?>
Donde le puedo hacer para poner la condicion que si es tipo admin me redireccione a inicio_administrador.php y si es tipo profesor me redireccione a inicio_profesores.php

Gracias