• 10-11-2016, 23:58:48
    #1
    merhabalar admin panele giriş için aşağıdaki şifre kontrol yapısı uygun mu sizce?

    session_start();
    if(!isset($_POST['s']) and !isset($_SESSION['s'])){
    
    echo '
    <form action="index.php" method="post" accept-charset="utf-8">
    	<input type="password" name="s">
    	<input type="submit">
    </form>
    ';
    exit();
    }
    
    $s=$_POST['s'];
    $gs="88*99-55/";
    
    if($s == $gs){
    	$_SESSION['s'] = $s;
    	echo $_SESSION['s'];
    }elseif($_SESSION['s'] != $gs){
    	echo "bu sayfayı görüntülemeye yetkiniz yok. post: ".$s;
    	header ("refresh:10;Location:index.php");
    	exit();
    }
  • 11-11-2016, 01:38:11
    #2
    Şifreyi değişkende tuttuğunuz için yeterlidir, sorun yaşatmaz.
  • 15-11-2016, 10:40:36
    #3
    $gs'yi md5 olarak tutabilirsin ek olarak. Bir ek de kullanıcı kodu gibi bir sey daha ekleyebilirsin.