I am currently working on a school project, and recently I did not manage to complete login authorization. I use HASH and SALT to register new users. I cannot find any resources that make the session for me, so I decided to create an account here to ask my own question.
This is my register script:
$username = $_POST['username']; $email = $_POST['email']; $first = $_POST['fname']; $last = $_POST['lname']; $salt = crypt("sha512", false); $pass = $_POST['password']; $password = hash("sha512", $salt . $pass . $salt, false); $sql = "INSERT INTO `users` (`username`, `email`, `fname`, `lname`, `salt`, `password`) VALUES ('$username', '$email', '$first', '$last', '$salt', '$password')";
Then I have a checklogin.php script, that is action = "checklogin.php" on my index page, which is the login page. This is the full script: http://pastebin.com/tKrsHaFU (bin insert)
My question is how to check my users who come to the index.php page (login form) with users who are already in the database, remember that I have salt and hash on passwords.
source share