Hallo,
Da ich einen Minecraftserver habe und da auf dem selben Server MySQL läuft, wollte ich auch gerne die andere Datenabnk benutzen.
Ich habe vom Server die datenbank zum einloggen benutzt, aber die für das InGame geld bekomme ich iwie nicht hin
config.inc.php
PHP-Code:
<?php
$db_server = "IP";
$db_login = "root";
$db_pass = "";
$db_name = "authme";
$db_name_login = "authme";
$db_name_iconomy = "iconomy";
$fortschritt = '50';
?>
login.php
PHP-Code:
<?php
if(@isset($_POST['submit'])) {
$Accountname = @htmlentities($_POST['userid']);
$passwort = @htmlentities($_POST['userpass']);
$button = @htmlentities($_POST['submit']);
} else
$button = "";
if ( $button <> "" )
{
if ( isset($Accountname) )
{
if ( isset($passwort) )
{
$right = 2;
$result = mysql_query("SELECT * FROM `authme` WHERE `username` = '$Accountname'");
while ( $daten = mysql_fetch_array($result) )
{
if ( $daten["username"] == $Accountname )
{
if ( $daten["password"] == md5($passwort) )
{
$right = 1;
$_SESSION['Spoofy']['login'] = $daten["username"];
$pInfo = @mysql_fetch_array(mysql_query("SELECT `$db_name_iconomy` FROM `authme` WHERE `username` = '$Accountname'"),MYSQL_ASSOC);
$_SESSION['Spoofy']['Coins'] = $pInfo["balance"];
$_SESSION['Spoofy']['Admin'] = 0;
if ( $_SESSION['Spoofy']['Coins'] == null ) { $_SESSION['Spoofy']['Coins'] = 0; }
// Sonstiges :P
echo '<div class="blueContainer bar"><div class="blueContainerInner">Sie werden in 3 Sekunden weitergeleitet.</div></div>';
echo '<meta http-equiv="refresh" content="3; URL=index.php" />';
}
}
}
if ( $right == 2 ) { echo "Benutzername oder Passwort falsch."; }
}
else { echo "Bitte geben sie ein Passwort ein."; }
}
else { echo "Bitte geben sie ein Benutzernamen ein."; }
}
?>
Aber warum sagt der immer "0" an ?
