02-12-05, 16:17
|
# 10
|
הוסטסניון
|
זה כל הקוד
PHP קוד:
$result2=mysql_query("SELECT * FROM `members`");
if (!$result2)
die("ERROR: error occured in MySQL query.");
while ($row=mysql_fetch_array($result2))
{
$user_table[$row['user']] = $row['sisma'];
}
print_r($user_table);
// Check if data was posted to script
if ($_POST)
{
// Loop through table
foreach($user_table as $username=>$password)
{
// Check if md5's of user/pass match passed values
if (($_POST['username_md5'] == md5($username)) AND ($_POST['password_md5'] == md5($password)))
{
// The user/pass combo matched
echo '1';
exit;
}
}
// The user/pass combox did not match
echo '0';
exit;
}
else
{
// Output message if nothing is posted (eg. if script is loaded into a web-browser)
echo "$user_table";
}
|
|
|