joomla is an all inclusive program like dreamweaver that is used as a web building tool. it includes php, sql, and some other scripts as well as its own toolkits to make things easier for web publishers and webpage designers. it is free, open source, and very user friendly. as for your initial question, i can give you a copy of my login script:
bear in mind that i have an accompanying stylesheet and some complementary files that make this look better. this should be enough to get you started though. change your login info for the $db variable. questions? lemmie know.
<?php
$db = mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD)
or die ('Unable to connect. Invalid username or password.');
$username = (isset($_POST['username'])) ? $_POST['username'] : '';
$password = (isset($_POST['password'])) ? $_POST['password'] : '';
$username = stripslashes($username);
$password = stripslashes($password);
$username = mysql_real_escape_string($username);
$password = mysql_real_escape_string($password);
$tmpname = (isset($_SESSION['tmpname'])) ? $_SESSION['tmpname'] : '';
$tracker = 0;
if (isset($_POST['submit']))
{
$tracker = 1;
$tmpname = $username;
$query = 'SELECT
id, permission_level, name, last_login
FROM
clients
WHERE
username = "' . $username . '" AND
password = PASSWORD("' . $password . '")';
$result = mysql_query($query, $db) or die(mysql_error($db));
if($row = mysql_fetch_array($result))
{
$_SESSION['user_id'] = $row['id'];
$_SESSION['permission_level'] = $row['permission_level'];
$_SESSION['name'] = $row['name'];
mysql_query($query, $db) or die (mysql_error($db));
}
}
if (isset($_SESSION['name']))
{
echo '<div id = "userset"><table cellspacing = "20px"><tr>';
echo '<td>Welcome, ' . $_SESSION['name'] ;
echo '</td><td>';
echo '<a href = "logout.php">';
echo "Log out " . $_SESSION['name'] . "</a>";
if($_SESSION['permission_level'] == 1)
{
echo ' | <a href = "admin.php">Admin</a>';
}
echo ' | <a href = "profile.php">Profile</a>';
echo '</td>';
?>
<form action = "search.php" method = "get">
<td><input type = "text" id = "search" name = "keywords" /></td>
<td><input type = "submit" value = "search" /></td></tr>
</form>
<?php
date_default_timezone_set ('America/Chicago');
echo '<tr>';
echo '<td></td><td>';
echo date('F j');
echo ', ';
echo date('Y');
echo ' ';
echo date ('H:i');
echo '</td></tr></table></div>';
}else{
?>
<form action = "homepage.php" method = "post">
<table id = "loginbox" cellspacing = "20px">
<tr>
<th style = "color: #8af;">Please Log In</th>
<th>Username:
<input type = "text" id = "user" name = "username" maxlength = "20" size = "20" value = "<?php echo $tmpname; ?>" /></th>
<th>Password:
<input type = "password" id = "pass" name = "password" maxlength = "20" size = "20" /></th>
<th><input type="submit" id = "loginsubmit" name = "submit" value = "" /></th>
<th style = "color: #8af;">Or <a href = "register.php" title = "register">Register</a></th>
</tr>
<tr>
<td colspan = "7" ><a href="forgot_password.php">Forgot your password?</a></td>
</tr>
<tr><td colspan = "7">
<?php
if ($tracker == 1)
{
echo 'You have enterened an invalid username and password combination.';
}
echo '</td></tr><tr><td colspan = "7">';
if ($tracker == 1)
{
echo 'Please try again.';
}
echo '</td></tr>';
?>
</table>
</form>
<?php } ?>