MySQL UCP
#3

Try this code:

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
    {
        
$username mysql_real_escape_string($_POST['username']);
        
$password mysql_real_escape_string($_POST['password']);
        
        
$hashedpw strtoupper(hash("whirlpool"$_POST['password']));
        
        
$check get_row("SELECT `playerLevel`,`playerName` from `playerdata` where `name` = '$username' and password = '$hashedpw'");
        if(isset(
$check['playerLevel']))
        {
            
go('index.php''Succesfully logged in.');
            
            
$_SESSION['playername'] = $check['name'];
            
$_SESSION['playerlevel'] = $check['level'];
        }
        else
        {
            
go('index.php''Wrong username or password.');
        }
    }
    
?>
Reply


Messages In This Thread
MySQL UCP - by Melktert - 25.03.2016, 20:26
Re: MySQL UCP - by Melktert - 26.03.2016, 09:37
Re: MySQL UCP - by buburuzu19 - 26.03.2016, 10:20
Re: MySQL UCP - by Melktert - 26.03.2016, 11:21
Re: MySQL UCP - by buburuzu19 - 26.03.2016, 12:02
Re: MySQL UCP - by Melktert - 26.03.2016, 13:30
Re: MySQL UCP - by buburuzu19 - 26.03.2016, 13:44
Re: MySQL UCP - by X337 - 26.03.2016, 14:03
Re: MySQL UCP - by buburuzu19 - 26.03.2016, 14:14
Re: MySQL UCP - by X337 - 26.03.2016, 14:20

Forum Jump:


Users browsing this thread: 2 Guest(s)