Example #1
0
<?php

define('DIRECT', true);
$configs = (require_once 'config.php');
require 'functions.php';
$conn = buildConn($configs);
if (empty($_GET)) {
    die;
}
if (empty($_GET['m'])) {
    $playerInfo = getPlayerInfo($conn, $_GET['id']);
} else {
    $playerInfo = getBestMatch($conn, $_GET['id']);
}
echo '<p class="muted text-center">';
echo "Wins: " . $playerInfo['wins'] . "</br>";
echo "Losses: " . $playerInfo['losses'] . "</br>";
echo '</p>';
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Setting up...</title>
</head>

<body>
<p>Setting up RIMS, please wait a couple second.....</p>
<p><img src="loader.gif" width="56" height="21" alt="loading" /></p>
<?php 
error_reporting(0);
$host = $_REQUEST['host'];
$user = $_REQUEST['user'];
$pass = $_REQUEST['password'];
include "buildConn.php";
buildConn($host, $user, $pass);
$wipe = $_REQUEST['wipe'];
$filename = 'localhost.sql';
if ($wipe == 1) {
    // Connect to MySQL server
    mysql_connect($host, $user, $pass) or die('Error connecting to mysql');
    // Temporary variable, used to store current query
    $templine = '';
    // Read in entire file
    $lines = file($filename);
    // Loop through each line
    foreach ($lines as $line) {
        // Skip it if it's a comment
        if (substr($line, 0, 2) == '--' || $line == '') {
            continue;
        }