PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
function user_isloggedin($name,$pass)
{
if(isset($name) && isset($pass) && $auth != "false")
// not quite sure about the !=, but it's the only operator that would make sense to me
// edit: it doesn't make sense even this way, but what do I know ;)
{
mysql_connect($mysql_server, $mysql_user, $mysql_pass);
mysql_select_db($mysql_db);
$sql = "SELECT * FROM users WHERE user="$name" AND pass="$pass";
$result = mysql_query($sql);
$num = mysql_numrows($result);
if ($num != 0)
return 1;
//you're aware of returning void if $num==0 ?
}
else
return 0;
}
to find errors like the second one try highlighting editors like PHPEdit (which shows correlating brackets as well)