I'm making a gateway script that only allows a forum user to enter an area if they have over 5 points.
The code I have so far, selects the username and points from the MySQL tables.
The PHPBB2 password tables are encrypted using the MD5 encyrption.
How would I encorporate the password checking in the code below. Also, I can only seem to make it print the correct message if you have 5 points only, not more than. How could I make the file print the correct message if the users' points were OVER or EQUAL to 5?
<?php
mysql_connect("localhost","zingbats","WHEVER PWL");
mysql_select_db (tycooneden_com);
$user_id = ( isset($HTTP_GET_VARS['user_id']) ) ? intval($HTTP_GET_VARS['user_id']) : 0;
$sql = "SELECT * FROM `phpbb_users` WHERE username = '$user'";
$result = mysql_query($sql);
while($r=mysql_fetch_array($result)) /*this causes the loop to be ran until the query is empty*/
{
$user_points = $r["user_points"];
$username = $r["username"];
print "welcome ";
print $username;
if ($userpoints = 5) {
print " you do not have 5 points";
} else {
print " you do have 5 points";
}
}
?>