|
|
| go ahead... be a heretic | |
| PerlMonks |
Re: DBI & MySQL Login Testby astroboy (Chaplain) |
| on Aug 25, 2009 at 04:03 UTC ( #790973=note: print w/ replies, xml ) | Need Help?? |
|
If you're checking logins against a user table, you could count the number of rows that match your u/p combination
Of course, you probably shouldn't store your passwords in plain text. Assuming you've got some sort of one way encryption going on (using Perl's crypt, or a MD5 or SHA module), you could simply replace the test with
By the way, don't interpolate variables in your SQL, or you'll make your login susceptible to a SQL injection attack. Always use placeholders Update: corrected syntax
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||