Solved

php ajax login system

Posted on 2010-09-20
4
486 Views
Last Modified: 2012-08-13
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
Comment
Question by:nandananushil1
  • 4
4 Comments
 
LVL 6

Accepted Solution

by:
Ludwig Diehl earned 500 total points
ID: 33719502
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
 
LVL 6

Expert Comment

by:Ludwig Diehl
ID: 33719517
ohh I forgot to attach th db dump file.
db-login.zip
0
 
LVL 6

Expert Comment

by:Ludwig Diehl
ID: 33719633
0
 
LVL 6

Expert Comment

by:Ludwig Diehl
ID: 33720036
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

These days socially coordinated efforts have turned into a critical requirement for enterprises.
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to count occurrences of each item in an array.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now