Unhashing Passwords for UCP
#9

It does not seem to be working, I have the following code:
PHP код:
<?php 
include("config.php");
session_start();
error_reporting(0);
$submit $_POST['submit'];
$username $_POST['username'];
$password hash('whirlpool'$_POST['password']);  
if(
$submit)
{     
    if(
$username && $password)
    {   
        
$query mysql_query("SELECT playerName, playerPassword FROM playeraccounts WHERE playerName = '$username'");
        if(
mysql_num_rows($query) == 1)
        { 
            while(
$row mysql_fetch_assoc($query))
            { 
                
$dbusername $row['playerName']; 
                
$dbpassword $row['playerPassword'];
            } 
            if(
$username == $dbusername && $password == $dbpassword)
            { 
                
$_SESSION['username'] = $dbusername;
                echo 
header('location: profile.php'); //redirecting user to his profile page (profile.php) 
            

            else 
            {
                
header('location: ucp.html'); //if user isn't loged in it will redirect him on login.php 
                
echo '.$password';
            }
        } 
        else 
        {
        
header('location: ucp.html'); //if user isn't loged in it will redirect him on login.php  
        
echo '.$password';
        }
    } 
    else 
    {
        
header('location: ucp.html'); //if user isn't loged in it will redirect him on login.php  
        
echo '.$password';
    }

mysql_close();
flush();
?>
Is says that the password is invalid each time. :/
Reply


Messages In This Thread
........ - by NickD - 31.05.2013, 23:44
Re: Unhashing Passwords for UCP - by Kirollos - 31.05.2013, 23:46
Re: Unhashing Passwords for UCP - by DanLore - 31.05.2013, 23:46
Re: Unhashing Passwords for UCP - by iTorran - 31.05.2013, 23:47
........ - by NickD - 31.05.2013, 23:57
Re: Unhashing Passwords for UCP - by DanLore - 01.06.2013, 00:01
Re: Unhashing Passwords for UCP - by nmader - 01.06.2013, 00:41
Re: Unhashing Passwords for UCP - by DanLore - 01.06.2013, 00:47
Re: Unhashing Passwords for UCP - by nmader - 01.06.2013, 00:56
Re: Unhashing Passwords for UCP - by iTorran - 01.06.2013, 01:12

Forum Jump:


Users browsing this thread: 3 Guest(s)