Pyost is right--you definitely need more than just FrontPage.
Okay, if you've already created a database, then just paste the code that was given to you in a file. I'll go with PHP for now:
CODE
PHP $dbh=mysql_connect ("localhost", "deatncom_shnabo", "<PASSWORD HERE>") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("deatncom_logindb");
Paste this in a .php file and replace <PASSWORD HERE> with the password you specified while creating the database. Once you run the file, the database connection will be opened. Also remember to put <?php and ?> around the PHP code.
Then, afterwards, you want to create a table in the database to hold your login information. (Use PhpMyAdmin if you're using MySQL) You could go with three fields (username, password, email, id) for a very very simple user registration. For the username, password, and email you should leave the field type as varchar with a length of your choice. For the id, use a type of int and set it as a primary key. Also, under extras, set the id to 'auto_increment'. The id is mostly for internal tracking purposes and won't be of much use to the end-user.
Under the different options, you shouldn't need to touch collation, attributes, and null. Default you can set if you want there to be a default value for each field. (Not really applicable in your situation, I think)
Clicking save should also generate PHP code that can be used to create the exact same table if you paste it in a php file.
Then, in order to access the table, you should use mysql. First you'd want to create a registration page (let's say called register.php). In it you'd have:
CODE
<form action="register.php" method="post">
<label for="username">Username: </label>
<input type="text" name="firstname"><br />
<label for="password">Password: </label>
<input type="password" name="password"><br />
<label for="email">Email: </label>
<input type="text" name="email"><br />
</form>
As a side note, I typed this in the browser, so there's no guarantee it'll work right off the bat. Now, to break apart the tags within <form></form>...
[a] the action attribute within <form> -- this is where the form directs to, and it's also where you want to put the php code to execute data received from the form
[b] the method attribute within <form> -- this tells the browser how to send the information. It can either be POST or GET. If it's GET, the data will appear in a website's url--ex: www.example.com/something.php?actid=5 If it's POST, the data is hidden. For something sensitive like registration or logging in, POST should always be the one used
[c] the name attribute in the input tag -- this is the name that's used by PHP to access the data--you'll see later.
Moving on...
Now, to access the form data that a user has entered, in register.php we'd want to have:
CODE
<?php
$username = $_POST["username"];
$email= $_POST["email"];
$password= $_POST["password"];
?>
Suppose the user entered helpless as the username, iowf83M as the password and weoiwho@gmail.com as the email. Then the variables $username, $email, and $password should contain the respective data. The array variable $_POST is defined by PHP to access data from a form with a method of POST. The ["username"] part of the variable is the value defined in name in the input tag.
Before you do anything with the password, you should md5 has it for security purposes. Ex:
CODE
<?php
$password = md5($password);
?>
md5 is a (nice) built-in function in php that does what it says.
Once you've got the data within variables and hashed accordingly, you'd want to use this to insert the data into the database:
CODE
<?php
mysql_query("INSERT INTO <table_name> (username, password, email)
VALUES ('$username', '$password', '$email')");
?>
To break the mysql query down, INSERT INTO is very obvious. Replace <table_name> with the name of your table. (Most likely users or something like that). The stuff between the parentheses are the fields you want to insert into--username, password and email. The values correspond to their respective fields.
Now that the data is in the database, to retrieve it, we use another mysql query.
CODE
$username = $_POST["username"];
$email= $_POST["email"];
$password= $_POST["password"];
$result = mysql_query("SELECT * FROM users WHERE username='$username' AND password='$password'");
The select query gets the user where username is the username entered and password is the password entered. If $result exists, then the user can be logged in.
This is the most basic aspects of a login system, and it's not even fully complete yet. For a secure login system, check out
http://www.devshed.com/c/a/PHP/Creating-a-...P-Login-Script/ . Of course, you'd need stripslashes to make sure that sql injections won't work. And as incoherent last words, it's best to use a framework for larger projects (I recommend CakePHP)
Comment/Reply (w/o sign-up)