first off, you should probably have a database structure. the one I usually use is:
create table users(
uID int not null auto_increment primary key,
uName varchar(15) not null,
pass varchar(13) not null,
email varchar(60) not null,
url varchar(60));
uID is used for queries such as showprofile.php?uID=$uID
uName is set to a varchar(15) since the most web-sites out there ask for maximum of 15.
pass is encrypted in the PHP script with the crypt() function.
email is helpful to have, and url is optional after you have this made, you should make a test account by entering this into the MySQL
Insert into users (uName, pass, email) values('test', 'xx1LtbDbOY4/E', 'test');
(xx1LtbDbOY4/E is the product of crypt("test", "xx") this will be tested on the login script.
now you are ok to test it when you get to it.
Now, on to the HTML. Make your table (one who's action is <?=$PHP_SELF?>. For this form, all you need is a username field, a password field (< input type="password"> is a good idea), and a submit button.
the names for each should be something like: "username", "password", "submitted".
once you have all this done, you need some sort of form processor / login script.
if($submitted && $username && $password)
{
connectDB(); // this is a connect to database function I wrote
$query = mysql_query("select pass, uID from users where name='$username'");
$userinfo = mysql_fetch_row($query);
if(crypt($password, 'xx') != $userinfo[0])
{
echo "The password you specified does not match the login name.";
exit;
}
// code for when the correct info is given.
// you should also look into session
// registering. sessions are a secure way
// to keep the user logged in.
exit;
}
then you should be all set, just alter the code I've given you and things should go smooth