View difference between Paste ID: Ke9reEpw and WX4RUdPN
SHOW: | | - or go back to the newest paste.
1
<?php
2
    
3
    /*
4
     * Author: iExit
5
     * Created on: 19.07.2014
6
     * Last edit: --/--/--
7
     * File: onlineAPI
8-
     * Description: OnlineAPI for getOnlineCount from Phoenix Habbo Retros.
8+
     * Description: OnlineAPI Phoenix Habbo Retros.
9
     */
10
     
11
    ini_set('display_errors',1);
12
13
    $conf = array(
14
        'host' => '', // database host.
15
        'user' => '', // database user (default: root)
16
        'pass' => '', // database password
17
        'db' => ''    // database 
18
    );
19
20
    $mySQLi = new MySQLi($conf['host'], $conf['user'], $conf['pass'], $conf['db']) or die($mySQLi->error);
21
22
    $server_status = $mySQLi->query("SELECT users_online FROM server_status") or die($mySQLi->error);
23
    $row = $server_status->fetch_assoc();
24
    
25
    $system_stats = $mySQLi->query("SELECT users FROM system_stats") or die($mySQLi->error);
26
    $system = $system_stats->fetch_assoc();
27
28
    $json = array(
29
        'users_online' => $row['users_online'],
30
        'users_rekord' => $system['users']
31
    );
32
33
    header('Content-type: text/javascript');
34
    echo json_encode($json);