Ok well thanks. I was reading this tutorial while waiting on a reply and it keep saying assuming register_globals are off. i looked in my php.ini file and it was on. so i turned it off and then my login script quick working. maby u can tell me why.
<html>
<head>
<link rel="stylesheet" type="text/css" href="eg.css" />
</head>
<body>
<?php
if($submit)
{
$db = mysql_connect("localhost", "root");
mysql_select_db("members",$db);
$user = "SELECT username,password FROM members WHERE username = '$username' AND password =
'$password'";
$result = mysql_query($user);
if (mysql_num_rows($result) > 0)
{
echo "Welcome $username";
}
else
{
echo "Sorry, please check you username and password!";
}
}
else
{
?>
<form method="get" action="<?php echo $PHP_SELF?>" target="body">
<h3>Username:</h3><input type="Text" name="username">
<h3>Password:</h3><input type="password" name="password">
<input type="submit" name="submit" value="submit">
<?php
}
?>
</body>
</html>