<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Üye Girişi</title>
<style type="text/css">
.hepsi{ width:700px ; height:380px; margin:100px auto; background:#fff; padding:20px 0 0 0}
.genel{border:1px solid #d3d3d3; width:350px; height:350px; margin:180px auto; background:#36648b; border-radius:5px}
.baslik{
  font:12px Arial, Tahoma, Verdana;
  width:300px;
  height:10px;
background:#F63;  
color:#fff; 
padding:10px;
font-weight:bold;
margin:20px auto;
text-align:center; border-radius:2px}
.panel{ width:300px; height:auto; margin:0px auto;
font:bold 13px Arial, Tahoma, Verdana; color:#fff}
input { height:30px; background:#36648b; border:1px solid #CCC; margin:0 0 0 50px; width:150px}
#buton{ width:100px; height:20px; background:#F63; margin:0 0 0 190px; color:#fff}
.resim{ width:300px; height:auto; margin:15px auto;}
a{ font:bold 12px Tahoma, Geneva, sans-serif; color:#999}
</style>
</head>

<body>
<?php
include("baglan.php");
/*ob_start();
session_start();
 
$kadi = $_POST['kadi'];
$sifre = $_POST['sifre'];
 */
session_start();

$kadi= mysqli_real_escape_string($baglan,$_POST['kadi']);
$sifre= mysqli_real_escape_string($baglan,$_POST['sifre']);
 
$sql="select * from uye WHERE kadi='".$kadi."' AND SIFRE='".$sifre."'";

$sonuc= mysqli_query($baglan,$sql);
if (mysqli_num_rows($sonuc)>0)
{ 
$satir= mysqli_fetch_array($sonuc);
$_SESSION['login']="true";
$_SESSION['kadi']=$kadi;
$_SESSION['sifre']=$sifre;
echo '<script>window.location.href ="starter.php";</script>';
  /* $_SESSION["login"] = "true";
    $_SESSION["kadi"] = $kadi;
  $_SESSION["ad"] = $ad;
    $_SESSION["sifre"] = $sifre;
    header("Location:starter2.php");*/
}

else
{
    if($kadi=="" or $sifre=="") {
        echo "<center>Lütfen kullanıcı adı ya da şifreyi boş bırakmayınız..!<a href=javascript:history.back(-1)>&nbsp;&nbsp;Geri Dön</a></center>";
    }
    else {
        echo "<center>Kullanıcı Adı ya da Şifre Yanlış.<br><a href=javascript:history.back(-1)>Geri Dön</a></center>";
    }
}


//Veritabanından gelen verileri Session oluşturma
        $veri=mysqli_query($baglan , " SELECT * FROM uye where kadi='".$kadi."' and sifre='".$sifre."' ");
                    while($cek=mysqli_fetch_array($veri)){
                      if($cek['kadi']!=""){
                        $kadi=$cek['kadi'];
                        $sifre=$cek['sifre'];
                        $ad=$cek['ad'];
                        $_SESSION["login"] = "true";
                        $_SESSION["ad"] = $ad;
            $_SESSION["kadi"] = $kadi;
                        header("Location:starter.php");
                      }
                      else{
                        echo "Giriş Yapılamadı";
                      }
                    }
          
          
 
ob_end_flush();
?>
<div class="genel">
<div class="resim"><img src="indir.png" width="300" /></div> 
<div class="baslik">ÜYE GİRİŞİ</div>
<div class="panel">
<form action="" method="post" >
<p>Kullanıcı adı : 
  <input name="kadi" type="text" /> </p>
<p>Şifre :    
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input  name="sifre" type="password" />     </p>
 <p> <input class="buton" type="submit" value="Giriş" id="buton"  />   </p>

 </form>
 </div>

 </div>
</body>
</html>
