Veritabanı ayar dosyası
<?php
$baglan = new mysqli("localhost","emr","1","personel");
$baglan->set_charset("utf8");
?>Giriş Sayfası<?php
include("ayar.php");
if ($_POST) {
$kullanici = $_POST["kullanici"];
$sifre = $_POST["sifre"];
$sorgu = $baglan->query("select * from kullanici where (kullanici='$kullanici' && sifre='$sifre')");
$kayitsay = $sorgu->num_rows;
if ($kayitsay > 0) {
setcookie("kullanici","msb",time()+60*60);
$_SESSION["giris"] = sha1(md5("var"));
echo "<script> window.location.href='anasayfa.php'; </script>";
} else {
echo "<script>
alert('HATALI KULLANICI BİLGİSİ!'); window.location.href='index.php';
</script>";
}
}
?>
