Mettodog:
Sites that have users and the ability to login, such as tek-tips, usually have an extensive database behind the site. MySQL is a good choice.
Now on to your questions.
1. When a new user is created, the database that tek-tips uses is updated, adding a new row, i.e., if there was an id field, an username field, and a password field, the id field would be incremented by one and username and password fields would be updated with the new username and password. Now, the next time that the user logs in with his username and password, a script searches the database to check to see if the user exists, if so, allows them to enter.
2. There are thousands of online tutorials for php/mysql interaction. Try
there is a wonderful FAQ for the PHP forum here that tells you how to connect to a mysql database.
3. Here is a simple login script that I wrote:
[tt]
$conn = mysql_connect($dbhost,$dbuser,$dbpass);
mysql_select_db("messages",$conn);
$query = "SELECT * FROM users WHERE username='$username' AND password='$password'";
$getval = mysql_query($query);
if(mysql_num_rows($getval) > 0) {
echo "<html><head><title>signed in</title>\n";
$password = md5($password);
echo "<meta http-equiv=\"Refresh\" content=\"1; URL=lobby.php?username=$username&password=$password\">\n";
echo "</head>\n";
echo "welcome<br>\n";
} else {
echo "We are sorry. You do not appear to be in our database. Click <a href=\"index.php\">here</a> to sign up</a>\n";
}
[/tt]
Most of it probably won't make sense until you learn about MySQL and PHP.
Hope this helps,
-Vic vic cherubini
vikter@epicsoftware.com
====
Knows: Perl, HTML, JavScript, C/C++, PHP, Flash, Director
====