Link to home
Start Free TrialLog in
Avatar of nandananushil1
nandananushil1Flag for India

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 :)
ASKER CERTIFIED SOLUTION
Avatar of Ludwig Diehl
Ludwig Diehl
Flag of Peru image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ohh I forgot to attach th db dump file.
db-login.zip
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.
function generateHash($sPlainText,$sSalt)
{    
    $aPlainText     = str_split($sPlainText);
    $sPlainText     = '';
    foreach($aPlainText as $sChar)
    {
        $sPlainText.= $sSalt.$sChar;                     
    }
    $sPlainText=sha1($sPlainText);
    return $sPlainText;
}

Open in new window