Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 499
  • Last Modified:

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 :)
0
nandananushil1
Asked:
nandananushil1
  • 4
1 Solution
 
Ludwig DiehlSystems ArchitectCommented:
Here I have made an example for u. It is very simple however it achieves what u want. About salting, let me give an example later.. cheers
php-ajax-login-system.zip
0
 
Ludwig DiehlSystems ArchitectCommented:
ohh I forgot to attach th db dump file.
db-login.zip
0
 
Ludwig DiehlSystems ArchitectCommented:
0
 
Ludwig DiehlSystems ArchitectCommented:
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

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now