forked from zilveer/Multiplayer-PHP-Ajax-Games
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sglobals.php
61 lines (54 loc) · 1.13 KB
/
sglobals.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
session_start();
if(get_magic_quotes_gpc() == 0)
{
foreach($_POST as $k => $v)
{
$_POST[$k]=addslashes($v);
}
foreach($_GET as $k => $v)
{
$_GET[$k]=addslashes($v);
}
}
require "global_func.php";
if($_SESSION['loggedin']==0) { header("Location: login.php");exit; }
$userid=$_SESSION['userid'];
$staff=1;
require "header.php";
include "config.php";
global $_CONFIG;
define("MONO_ON", 1);
require "class/class_db_mysql.php";
$db=new database;
$db->configure($_CONFIG['hostname'],
$_CONFIG['username'],
$_CONFIG['password'],
$_CONFIG['database'],
$_CONFIG['persistent']);
$db->connect();
$c=$db->connection_id;
$set=array();
$settq=$db->query("SELECT * FROM settings");
while($r=$db->fetch_row($settq))
{
$set[$r['conf_name']]=$r['conf_value'];
}
$domain=$_SERVER['HTTP_HOST'];
$is=$db->query("SELECT * FROM users WHERE userid=$userid");
$ir=$db->fetch_row($is);
if($ir['user_level'] <= 1)
{
print("403: Access Denied");
$h->endpage();
exit;
}
$h = new headers;
$h->startheaders();
$fm=number_format($ir['money'],2);
$fm="\$".$fm;
$lv=date('F j, Y, g:i a',$ir['laston']);
$staffpage=1;
$h->userdata($ir,$lv,$fm,$cm);
$h->menuarea();
?>