I`m kinda new as well only a few months.... But this is basicly what I used...
<?
$db_name = "db_name";
$table_name = "table_name";
$connection = @mysql_connect("host", "db_name", "pass")
or die("Couldn't connect.");
$db = mysql_select_db($db_name)
or die("Couldn't select database.");
$sql = "SELECT id
FROM users
WHERE username='$username' and password='$password'";
$result = mysql_query($sql)
or die ("Can't execute query.");
$num = mysql_numrows($result);
if ($num == 1) {
include "http://yoursite.com/member_page";
}
else if ($num == 0) {
header("Location: http://yoursite.com/login.htm");
exit;
}
?>
Hope it helps... This is the basic approach. You can easily customize it.
You`ll need a table "users" and fields "id" "username" and "password"