Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function extractData($t) {
- // Uncompress Data
- $t = gzuncompress($t);
- // Get Position of Cols/Rows
- $s1 = strpos($t, '*') + 1;
- $s2 = strpos($t, '*', $s1);
- // Extract Cols/Rows
- $rows = substr($t, 0, $s1-1);
- $cols = substr($t, $s1, $s2-$s1);
- // Extract Data
- $c = $s2 + 1;
- for($i = 0; $i < $rows; $i++) {
- for($x = 0; $x < $cols; $x++) {
- $n = strpos($t, ':', $c);
- $len = substr($t, $c, $n - $c);
- $data[$i][$x] = substr($t, $n + 1, $len);
- $c = $n + $len + 1;
- }
- }
- // Return Data
- return $data;
- }
- $t = file_get_contents('http://www.rankedgaming.com/api/fetchnames.php?0='.$_GET['acc_ID']);
- $data = extractData($t);
- $row[0] = $_GET['game_ID'];
- $row[1] = $_GET['player_ID'];
- $row[2] = $_GET['acc_ID'];
- $row[3] = $data[0][1];
- $row[4] = $_GET['time'];
- $row[5] = $_GET['status'];
- $row[6] = $_GET['IP'];
- $row[7] = $_GET['Hero'];
- $row[8] = $_GET['K'];
- $row[9] = $_GET['D'];
- $row[10] = $_GET['A'];
- $row[11] = $_GET['CK'];
- $row[12] = $_GET['CD'];
- $row[13] = $_GET['NK'];
- $row[14] = $_GET['item1'];
- $row[15] = $_GET['item2'];
- $row[16] = $_GET['item3'];
- $row[17] = $_GET['item4'];
- $row[18] = $_GET['item5'];
- $row[19] = $_GET['item6'];
- $row[20] = $_GET['LeftReason'];
- require 'connection.php' ;
- $query = mysql_query("INSERT INTO DB_game_players VALUES($row[0], $row[1], $row[2], '$row[3]', $row[4], '$row[5]', '$row[20]', '$row[6]', '$row[7]', $row[8], $row[9],$row[10], $row[11], $row[12], $row[13], '$row[14]', '$row[15]', '$row[16]', '$row[17]', '$row[18]', '$row[19]')");
- if (!$query){
- $fh = fopen('error_log.txt', 'a') or die("can't open file");
- fwrite($fh,"[".date('H:m:s d/m/y',time())."][Game #$row[0]][Player: #$row[1]]\n");
- fclose($fh);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment