This is working fine, apart from the password checking bit. It uses the code:
$sql=“SELECT * FROM login_admin WHERE user_name=‘$myusername’ and user_pass=SHA(‘$mypassword’)”;
The code SHA(‘$mypassword’)“; looks like it does something ‘fancy’ making the site more secure. But I cannot get the code to work with SHA. I can get it working without (by using user_pass=‘$mypassword’”
What is SHA supposed to do and how can I get it working?
For more information on the theory of hashes in general there’s this wiki article.
Note that the reason site admins use hashes instead of reversible encryption most of the time is for personal liability. Users tend to use passwords over and over - unfortunately this means they might use the same password at your site as they use at their bank! By hashing the password, especially by hashing and salting it, you destroy the original password information so if someone does compromise your database the liability is minimal.