dostum bunu kullan daha sağlıklı senin için yazdım
<?
if($_GET["islem"]=="giris"){
$kullanici = $_POST["kadi"];
$sifre = $_POST["sifre"];
if($_POST){
if (($kullanici != "") and ($sifre != "")) {
$sql = "select * from uyeler where `kullanici` = '".mysql_escape_string($_POST['kadi'])."' and `sifre` ='$_POST['sifre']' ";
if($sql) 
{$kontrol = mysql_query($sql);
$kontrol_ok = mysql_fetch_array($kontrol);//$kontrol_ok değişkenini nerde kullanıyorsun anlayamadım :D
setcookie ("giris", "$kullanici");
header ("Location: index.php");}
else{header ("Location: giris.php?hata=yes");}}}}
?>