Cały skrypt się wykonuje ale po wykonaniu nie przekierowuje do danego pliku (rps.php).
Skrypt:
<?php require_once ('header.php'); $key = "66DF348E89D52A9A1A6AB6308C94E0E3"; $auth = new SteamAuth(); $auth->SetOnLoginCallback(function($steamid){ return true; }); $auth->SetOnLoginFailedCallback(function(){ return true; }); $auth->Init(); $SteamCache = "steamauthRPS.json.cache"; $link = null; } } $link = file_get_contents('http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key='.$key.'&steamids='.$auth->SteamID.'&format=json'); file_put_contents($SteamCache, $link); } $profile = json_decode($link, true); $steamid = $auth->SteamID;} $stmt = $pdo->prepare("SELECT personaname, coins FROM users WHERE steamid = $steamid"); $stmt -> execute(); while($row = $stmt -> fetch(PDO::FETCH_ASSOC)){ $personaname = $row['personaname']; $coinsUser = $row['coins'];} $coins = $_POST['coinsAmount']; $symbol = $_POST['Symbol']; $defcount = $pdo->query("SELECT COUNT(*) FROM rpsbattles WHERE defender = '$personaname' and finished = 'NO'")->fetchColumn(); if($defcount >= 5) { } else { if($coins > $coinsUser) { } else { $stmt = $pdo->prepare("INSERT INTO rpsbattles (id, defender, defender_steamid, defender_symbol, attacker, attacker_steamid, attacker_symbol, coins, finished) VALUES (null, '$personaname', '$steamid', '$symbol', '', '', '', '$coins', 'NO')"); $stmt -> execute(); $calcResult = $coinsUser - $coins; $stmt = $pdo->prepare("UPDATE users SET coins = '$calcResult' WHERE steamid = $steamid"); } } } ?>