I'm trying to authenticate some users before they can get to some protected pages on the site. I couldn't get it to work so rite now i'm trying to do some REALLY basic authentication with this script and i still can't get it to work. I keep getting a parse error at the "$num = mysql_num_rows($result);" i don't know why. please help. This is my code:
<body>
<?php
$auth = false;
$db = mysql_connect("**", "", "*");
mysql_select_db("**",$db);
$result = mysql_query ("Select * from wusers where uname = '$username' AND password '$password ' ", $db);
$num = mysql_num_rows($result);
printf ("'$num");
if ($num !=0)
{
$auth = true;
echo '<p> You are Authorized! </P>';
exit;
}
else
{
echo 'Authorization Required.';
exit;
}
?>
</body>