Hi,
also ich habe folgendes Problem mit dem Script. Ich bekomme wenn ich alle eingaben gemacht habe "Account Updated", aber irgendwie wird die SQL-Datenbank nicht geupdated
Danke,
Chris
also ich habe folgendes Problem mit dem Script. Ich bekomme wenn ich alle eingaben gemacht habe "Account Updated", aber irgendwie wird die SQL-Datenbank nicht geupdated
PHP-Code:
<?
require_once("variables.php");
$auth_host = $GLOBALS['auth_host'];
$auth_user = $GLOBALS['auth_user'];
$auth_pass = $GLOBALS['auth_pass'];
$auth_dbase = $GLOBALS['auth_dbase'];
//Check username is valid else error and exit
if(is_null($user) || $user == "" || $user == " ")
{
echo "Auth Server - Invalid Account Name ";
exit();
}
//Check password is valid else error and exit
if(is_null($passcrc) || $passcrc == "" || $passcrc == " ")
{
echo "Auth Server - Invalid Password";
exit();
}
//Check Score is valid else error and exit
if(is_null($score) || $score == "" || $score == " ")
{
echo "Auth Server - No Score to add.";
exit();
}
//Check password and username match
$home = mysql_connect($auth_host, $auth_user, $auth_pass);
mysql_select_db($auth_dbase);
$query = "select * from account where username='$user'";
$result = mysql_query($query,$home);
$row = mysql_fetch_assoc($result);
$temppass = $row['password'];
$userid = $row['userid'];
$username = $row['username'];
$crcpass = crc32($temppass);
$sessions = $row['sessions'];
$accscore = $row['Kills'];
$allscore = $accscore+$score;
if($user != $username)
{
echo "Auth Server - Incorrect Username ";
exit();
}
if($user == $username && $crcpass != $passcrc)
{
echo "Auth Server - Incorrect Password ";
exit();
}
if($user == $username && $crcpass == $passcrc)
{
//Update score
echo "Updating Kills...<br>";
$query = "UPDATE account SET kills = '$allscore' WHERE username='$user'";
//Advise Server of updated data
echo "Auth Server - Account updated!";
}
?>
Chris
Kommentar