nandananushil1
asked on
php ajax login system
can u give me example of login script using php, mysql and ajax.
i am using sha1, but i don't know how to use salt. if possible can u explain me how do add salt and match it with password in db, but it is secondary ... main thing i wanna know is ajax login .. thanks loads :)
i am using sha1, but i don't know how to use salt. if possible can u explain me how do add salt and match it with password in db, but it is secondary ... main thing i wanna know is ajax login .. thanks loads :)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
meanwhile you can take a look at this http://pbeblog.wordpress.com/2008/02/12/secure-hashes-in-php-using-salt/
base on the link I sent...
I have modified it in order to make it a little bit stronger...You can try to get it even stronger. I suggest u use as a salt, the username for instance..or some whatever u want.
I have modified it in order to make it a little bit stronger...You can try to get it even stronger. I suggest u use as a salt, the username for instance..or some whatever u want.
function generateHash($sPlainText,$sSalt)
{
$aPlainText = str_split($sPlainText);
$sPlainText = '';
foreach($aPlainText as $sChar)
{
$sPlainText.= $sSalt.$sChar;
}
$sPlainText=sha1($sPlainText);
return $sPlainText;
}
db-login.zip