You are here: Hash Issues « PHP « IT news, forums, messages
Hash Issues

Posted by Erbacher Karl on 02/24/05 18:26

Hello,

I'm trying to hash passwords before saving them to a mySQL database but I am
having a problem. I created three seperate sample users with three different
passwords (password1, password2, password3). When I go back to look at the
table info in the database, it has saved the exact same hash value for all
three users. Any ideas why this might be happening?

The script is very straight forward.
The form that collects the data:
<input type='password' name='password'>
$pass=bin2hex(mhash(MHASH_SHA1, $password));
<input type='hidden' name='pass' value='$pass'>

The file that verifies the data and stores it to the database:
$pass=$_POST['pass'];
INSERT INTO table (username, password) VALUES ('$logname', '$pass');

Thanks,
Cat

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация