Help with UCP
#1

Hi, i am editing one UCP but i cant login with the password which i am registering from IG.
I am hashing my passwords with md5 and i can only login with the hashed password so i tryed a way to hash the password which player enters when he wants to login with the password which is already hashed in the database, but i cant get it to work
Can any PHP expert help me solve this problem?
PHP код:
$submit   $_POST['submit']; 
$logout   $_POST['logout']; 
$username sanitize($_POST['Name']); 
$password sanitize($_POST['Password']);
$rawInput sanitize($_POST["password"]);
$hashedInput hash("md5"$rawInput); 
if(
$submit)
{
    if(!
strcmp($password$hashedInput)) 
    {
        if(
$username && $password)
        {
            
$query mysql_query("SELECT * FROM `players` WHERE `Name` = '$username' AND `Password` = '$password'");
            if(
mysql_num_rows($query) == 1
            {
                while(
$row mysql_fetch_assoc($query)) 
                {
                    
$dbusername $row['Name']; 
                    
$dbpassword $row['Password']; 
                }
                if(
$username == $dbusername && $password == $dbpassword
                {
                    
setcookie("Name"$dbusernametime()+60*60*24*365*20);
                    
$_SESSION['Name'] = $dbusername
                    
header('Location: index.php');
                }
                else echo 
"<script>alert('You have to enter password!');</script>";
            }
        }
    }

Reply


Messages In This Thread
Help with UCP - by MadafakaPro - 25.09.2013, 17:33
Re: Help with UCP - by Alberto_DR - 25.09.2013, 17:39
Re: Help with UCP - by MadafakaPro - 25.09.2013, 19:31
Re: Help with UCP - by DanishHaq - 25.09.2013, 19:37
Re: Help with UCP - by tyler12 - 25.09.2013, 19:49
Re: Help with UCP - by MadafakaPro - 26.09.2013, 06:30
Re: Help with UCP - by MadafakaPro - 26.09.2013, 09:38
Re: Help with UCP - by [ABK]Antonio - 26.09.2013, 09:56
Re: Help with UCP - by DanishHaq - 26.09.2013, 09:58
Re: Help with UCP - by MadafakaPro - 26.09.2013, 10:05

Forum Jump:


Users browsing this thread: 1 Guest(s)