A
Anonymous
Guest
i am trying to make a little login facility, but i'm stuck...any 1 help???
code:
The POST method and the include are working fine.
The output is always boring
HELP????
code:
Code:
<?
//get the variable name
$username = $_POST['name'];
//get the variable password
$password = $_POST['password'];
include ("connect.php");
$query = "SELECT * FROM staff WHERE `username` = 'kumark2' AND `password` = 'kapil'";
$result = mysql_query($query);
$num = mysql_numrows($result);
mysql_close();
$i=0;
while ($i < $num)
{
$user=mysql_result($result,$i,"username");
$pass=mysql_result($result,$i,"password");
$staff=mysql_result($result,$i,"staff");
$surname=mysql_result($result,$i,"surname");
if ($user == $username)
{
echo "chiller";
}
else
{
echo "boring";
}
$i++;
}
?>
The output is always boring
HELP????