if (REQUIRED_KEY) { if (!isset($_GET["key"]) || $_GET["key"] != REQUIRED_KEY) { die("Clave de seguridad no valida. IP: {$_SERVER["REMOTE_ADDR"]}"); } } if (REQUIRED_IP) { if ($_SERVER["REMOTE_ADDR"] != REQUIRE_IP) { die("Acceso no permitido."); } } // if(REQUIRED_IP) if($_SERVER["REMOTE_ADDR"]!=REQUIRE_IP&&$_SERVER["REMOTE_ADDR"]!="**SU_IP***") die("Acceso no permitido."); if (!isset($_GET["login"])) { die("No ha ingresado el login."); } $login = strtr($_GET["login"], "['\"]\\/", " "); MyDB::myconnect(DB_HOST, DB_NAME, DB_USER, DB_PASS, DB_TYPE); $coins = CoinsData::findCoins(TABLE_NAME, ACCOUNT_FIELD, COINS_FIELD, $login); if ($coins === false) { die("Usuario no encontrado."); } if (isset($_GET["country"]) && isset($coins_per_country[$_GET["country"]])) { $coins += $coins_per_country[$_GET["country"]]; } else { $coins += COINS_DEFAULT_ADD; } CoinsData::sumCoins(TABLE_NAME, ACCOUNT_FIELD, COINS_FIELD, $login, $coins); die("OK"); //-------------------------------------------------------------------// class CoinsData { public static function findCoins($table, $account, $coins, $login)