<?php
require('veritabani.php');
error_reporting(0);
 @ob_start();

@session_start(); 

$username=$_POST['username'];
$password=$_POST['password'];

$username = stripslashes($username);
$password = stripslashes($password);

function isLoggedIn()
    {
        if(@$_SESSION['LoggedIn'])
        {
            return true;
        }
        else return false;
    }
	 
$sql="SELECT kullaniciadi,adisoyadi,sifre,cekyetki,ciroyetki,belgeiptalyetki,puanyetki  FROM KULLANICILAR where  RTRIM(sifre) = '$password'  ";
$result=odbc_exec($vtt,$sql) 
or die ("result error ".odbc_error().'-'.odbc_errormsg());
if (!odbc_fetch_row($result))
 header('location: gir.php');

else { 
@session_regenerate_id();
@$_SESSION['LoggedIn'] = true;
@$_SESSION['password']=$password;

header('location: kontrol.php');
}
function logout()
    {
        unset($_SESSION['LoggedIn']);
        unset($_SESSION['password']);
	    session_destroy();
        header('location: index.php');
    }
odbc_close($vtt);






?> 