Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $username = $_POST['username'];
- $salt = md5($_POST['password']);
- $password = hash('sha1', $salt);
- $userinfo = mysql_query("SELECT * FROM `users` WHERE `username` = '$username'") or die(mysql_error());
- $userpass = mysql_query("SELECT * FROM `users` WHERE `password` = '$password'") or die(mysql_error());
- $check = mysql_num_rows($userinfo);
- $checkpass = mysql_num_rows($userpass);
- if($check == '0');
- {
- echo "Sorry. You have entered the wrong username";
- }
- if($checkpass =='0');
- {
- echo "Sorry. You have entered the wrong password";
- }
- $_SESSION['user'] = "$username";
- $_SESSION['password'] = "$password";
- echo "You are being logged... Please wait...";
- echo "Redirecting you...";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement