PHP + Whirpool istant +REP
#4

1. Make sure that the passwords are both the same case, this matters.
2. On the login.php that you posted, you're not even using whirlpool. Instead of
PHP код:
$pass $_POST["parool"]; 
use
PHP код:
$pass hash('whirlpool'$_POST["parool"]); 
And do the same for
PHP код:
$newpass mysql_escape_string($_POST['newpass']); 
$newpassconfirm mysql_escape_string($_POST['newpassconfirm']); 
$password mysql_escape_string($_POST['currentpassword']); 
3. A better way to do the login would probably be the following:
PHP код:
$pass hash('whirlpool'$_POST["parool"]);
$querytxt "SELECT * FROM accounts WHERE Name = '$kasutaja' AND password = '$pass'"
$result mysql_query($querytxt); 
$nouser mysql_num_rows($result); 
if(
$nouser == 0)
{
    echo 
'<div class="oskar"><font color="red">User or password doesnt exist!</font><form name="input"> 
                Username: <input type="text" name="kasutaja" /> 
                Password: <input type="password" name="parool" /> 
                <br /> 
                <input type="button" value="Submit" onClick="get();" /> 
                </form></div>'

}
else
{
        echo 
"<ul class='sb_menu'> 
        <li><h3>Welcome, 
$kasutaja!</h3></li> 
        <li><a href='?page=ucp'>My Account</a></li> 
        <li><a href='logout.php'>Logout</a></li> 
        </ul>"

        
$_SESSION["kasutaja"] = $kasutaja

The above makes it so you don't need to fetch the whole line from the MySQL database.
Reply


Messages In This Thread
PHP + Whirpool istant +REP - by TheArcher - 05.04.2012, 21:33
Re: PHP + Whirpool istant +REP - by 1337connor - 05.04.2012, 21:36
Re: PHP + Whirpool istant +REP - by TheArcher - 05.04.2012, 21:40
Re: PHP + Whirpool istant +REP - by [HiC]TheKiller - 05.04.2012, 21:52
Re: PHP + Whirpool istant +REP - by TheArcher - 05.04.2012, 22:51
Re: PHP + Whirpool istant +REP - by TheArcher - 06.04.2012, 11:17
Re: PHP + Whirpool istant +REP - by kikito - 06.04.2012, 11:44
Re: PHP + Whirpool istant +REP - by TheArcher - 06.04.2012, 12:04
Re: PHP + Whirpool istant +REP - by kikito - 06.04.2012, 12:44
Re: PHP + Whirpool istant +REP - by TheArcher - 06.04.2012, 13:04

Forum Jump:


Users browsing this thread: 1 Guest(s)