<?php
    include('../db_function.php');                       
    
    session_start();    

	
    if(empty($_POST['txtUser']) and empty($_POST['txtPassword']))
    {      
    	//echo 'confirm 1';      
        header("location:login.php?goto=".$_GET['goto']);                  
        return;
    }             
    $user  = $_POST['txtUser'];
    $pass  = $_POST['txtPassword'];
    
//    echo "User:$user  <br>   Pas:$pass   <br>";
//    echo login($user,$pass);
    
    if(login($user,$pass))
    {            
        setcookie ("p0B_c0ff33", $user,time()+3600);
                        
        $_SESSION['p0B_c0ff33'] = $user;
        
//    	echo '<br> confirm 2';      
        header("location:".$_GET['goto'].".php");                  
    }
    else
//    	echo '<br> confirm 3';      
        header("location:login.php?goto=".$_GET['goto']);                  
  
?>
