Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $username = strtolower(preg_replace("/[^A-Za-z0-9]/","", $_POST['username']));
- $password = sha1($_POST['password']);
- ------------------------------------------------------------------------------
- $pwdchk =
- "
- SELECT * FROM userstbl WHERE username = '$username'
- ";
- $result = mssql_query($pwdchk);
- while($row = mssql_fetch_array($result))
- {
- if ($row['salt'] . sha1($_POST['password']) == $row['saltedpassword'])
- {
- echo "Successfully logged in";
- }
- if ($row['salt'] . sha1($_POST['password']) != $row['saltedpassword'])
- {
- echo "The password you used is incorrect.";
- echo "<br /><br />";
- echo $row['saltedpassword'];
- echo "<br /><br />";
- echo ($row['salt'] . sha1($_POST['password']));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement