How to Change to Sha1
#7

Quote:
Originally Posted by Yaa
Посмотреть сообщение
try now

PHP код:
<?php  
    session_start
();  
    include 
"koneksi.php";  
    if(isset(
$_SESSION['playername']))  
    {  
        
go('index.php''You already logged in.');  
    }  
    if(!isset(
$_POST['username'], $_POST['password']))  
    {  
        
go('index.php''Please fillout all required forms.');  
    }  
    else  
    {  
        
$query $koneksi->prepare("SELECT `level`,`name` from `player` where `name` = ? and `password` = ?");  
        
$query->execute(array($_POST['username'], sha1($_POST['password'])));  
        if(
$query->rowCount() > 0)  
        {  
            
$data $query->fetch();  
            
go('index.php''Succesfully logged in.');  
            
$_SESSION['playername'] = $data['name'];  
            
$_SESSION['playerlevel'] = $data['level'];  
        }  
        else  
        {  
            
go('index.php''Wrong username or password.');  
        }  
    } 
        else  
        {  
            
go('index.php''Wrong username or password.');  
        }  
    }
worked!! tahanks man
+1rep
Reply


Messages In This Thread
How to Change to Sha1 - by DandyCorleone - 04.01.2017, 10:37
Re: How to Change to Sha1 - by Yaa - 04.01.2017, 11:09
Re: How to Change to Sha1 - by DandyCorleone - 04.01.2017, 11:13
Re: How to Change to Sha1 - by DandyCorleone - 04.01.2017, 12:05
Re: How to Change to Sha1 - by BiosMarcel - 04.01.2017, 12:07
Re: How to Change to Sha1 - by Yaa - 04.01.2017, 12:17
Re: How to Change to Sha1 - by DandyCorleone - 04.01.2017, 13:19

Forum Jump:


Users browsing this thread: 1 Guest(s)