I'm sorta new to PHP, and only know basics about MySQL and PHP.... So any help? I know you're out there David T
Hehe lol - I'll see what I can do
First of all, grab a copy of ez_SQl - it makes life with mysql much easier.
Once that's done, here's a simple script that will add a user, and their password hash (their password, encrypted with their username, unique to every user) to the database:
<?php
inlude 'ezsql.php';
// Get the user's hash
$hash = crypt($pass, $username);
// Store in DB as new user
$sql = "INSERT INTO users('name', 'hash') VALUES ('$username', '$hash')";
$db->query($sql);
?>
Now that code has added a new user, here's what I use to see if a username nas password in valid. Look in the database for a user with the same hash as the user trying to log in, if there is then you cna log him in:
$sql = "SELECT * FROM user WHERE hash='$hash'";
$usersfound = $db->get_results($sql);
if($usersfound)
{
log him in
} else {
incorrect details
}