Why have you go these two lines on their own at the top ????
There is no need to have them there
$_POST['username'];
$_POST['password'];
Instead put extract($_POST);
HTH
GM
PHP CODE LOGIN.PHP
<?
$POST['username'];
$POST['password'];
$connection = mysql_connect("localhost", "root", "blah")
or die ("Couldn't connect to server.");
$db = mysql_select_db("peeps", $connection)
or die ("Couldn't select database.");
$sql = "SELECT id
FROM users
WHERE username='$username' and password='$password'";
$result = mysql_query($sql)
or die("Couldn't execute query.");
$num = mysql_numrows($result);
if ($num == 1) {
echo "<P>You are a valid user!<br>";
echo "Your username is $username<br>";
echo "Your password is $password</p>";
} else if ($num == 0) {
echo "You are not authorised"
}
?>
Problem is, is that it keeps showing "You are not authorised".... so i think its a problem with my POST, but not sure what
login.HTML
<html>
<head>
<title>Login</title>
</head>
<body>
<form action="login.php" method="POST" >
Username: <input type="text" name="username" size="20">
Password: <input type="password" name="password" size="20">
<input type="submit" value="Submit" name="login">
</form>
</body>
</html>
Thanks for ya input
Art [/B][/QUOTE]