php myAdmin mysql <? ?>

BROWSER-BASED * PHP5 SUPPORT * MYSQL 4.1 AND MYSQL 5.0 SUPPORT * OPEN SOURCE
PHP ve MySQL - En Yararlı Türkçe Kaynak
Kullanıcı Adınız : Kullanıcı Parolanız : Hatırla :    Kayıt   Şifremi Unuttum
Forum Ana Sayfa | Konu
Cevap Yaz
1
14:12 20.10.2009

Yazar :
pasion
Seviye:

php ve ajax ile login sayfa sorunu

--kontrol php --
[php]
<?php
/*
*kurTi Tasar&#253;m 
*www.kurtitasarim.com
*kurTi 2oo9
*/
/* ayar sa&#253;t&#253;r&#253; */
$varmi = include ("../ayar/_ayar.php");
/* ayar sat&#253;r sonu */
function kontrolPost($giris) {
    
$giris        =    htmlspecialchars($giris);
    
$giris        =    (get_magic_quotes_gpc()?$giris:addslashes($giris));
    return 
$giris
    }
    @
$kullanici    =    kontrolPost($_POST['kullanici']);
    @
$sifre        =    kontrolPost($_POST['sifre']);
    
$giris_durumu    =    TRUE;
    
$sql            =    "SELECT * FROM admingiris WHERE kullanici='$kullanici'";
    if(
$sql>0) { 
    
$sorgu            =    "SELECT * FROM admingiris WHERE kullanici='$kullanici' AND sifre='$sifre'"
    
$sorug1            =    mysql_query($sorgu);
    if(
$sorgu
    {
$giris_durumu=TRUE;} 
    else 
    { 
$giris_durumu=FALSE; } }
    else 
    { 
$giris_durumu=FALSE; }    
    
/* Sonuç ver */
    
if ($giris_durumu) {
    
$_SESSION['kul']=$kullanici;
    echo 
"Ok"
    } else {
    echo 
"Hatali";
    }

?>
[/php]
--panel js --
[php]
function ekle(){

if( document.getElementById('kullanici').value.length < 1 ) {        
    $('div.durum').html( '<div class="hata">Lütfen Kullanıcı Adınızı giriniz!</div>');
}

else if( document.getElementById('sifre').value.length < 1 ) {
    $('div.durum').html( '<div class="hata">Lütfen Parolanızı giriniz!</div>');
}

else {

    var a = "kullanici="+document.getElementById('kullanici').value;
    var b = "sifre="+document.getElementById('sifre').value;
    var sc = a+"&"+b;

    $('div.durum').html('<br /><center><img src="loadingAnimation.gif"></center>');
    $.ajax({
        type: "POST",
        url: "kontrol.php",
        data: sc,
        success: function(msg){
        if (msg=="ok")
            {
            $('div.durum').html('<div class="tamam">Giriş Başarılı :) Panele
yönlendiriliyorsunuz...</div>');
            setTimeout("window.location = 'index.php';",1000);
            }
        else
            {$('div.durum').html( '<div class="hata">'+msg+'</div>');}
       }
    });
    }

}
[/php]

--login php--
[php]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="css/style.css" type="text/css">
<!-- JS -->
<script type="text/javascript" src="js/panel.js"></script>
<script type="text/javascript" src="js/jquery.js"></script>
<!-- JS Sonu -->
<style type="text/css">
<!--
body {
    background:#333333 url(resim/login/bg.png);
}
-->
</style></head>

<body>
<div id="login">
<form  method="post" action="javascript:void(0);">
<div id="input_1">
<input type="text" name="kullanici" id="kullanici" class="kul" maxlength="18">
<div id="input_2">
<input type="password" name="sifre" id="sifre" class="kul" maxlength="16"></div>
<div id="submit">
<input onclick="ekle();"  type="submit" value="" class="submit"></div>
<div class="durum"></div>
</div>

</body>
</html>
[/php]
sorunum şu k.adı ve şifremi doğru girmemem rahmen hata veriyor
   

Toplam Online : 5 Toplam Üye : 2702 Bugün Gelen : 314 Bugün Çoğul : 5555 Toplam Gelen : 341316
 
 Son 30 dak. içinde online olan üyelerimiz :
php mysql php oracle ajax apache xml cozumleri w3c xhtml w3c css JavaScript Object Notation
yetkili servis