Forum Moderators: coopster
<html>
<head>
<title>Login</title>
<head>
<body>
<?PHP
//Connect to database
mysql_connect("localhost", "admin", "admin") or die(mysql_error());
mysql_select_db("ueros_db") or die(mysql_error());
session_start();
$username = $_POST[‘username’];
$password = md5($_POST[‘password’]);
$query = "SELECT * FROM users WHERE (username='$username' AND password='$password')";
$result = mysql_query($query);
if (mysql_num_rows($result) != 1) {
$error = "Bad Login";
include "login.html";
} else {
$_SESSION['username'] = "$username";
print("<h3>Welcome $username !</h3>");
include "members.php";
}
?>
</body>
</html>