-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathajax.php
30 lines (28 loc) · 850 Bytes
/
ajax.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
<?php
header('Content-Type: text/html; charset=utf-8');
require("class.db.php");
require("config.php");
$constring = "mysql:host=" . $config['host'] . ";port=" . $config['port'] . ";dbname=" . $config['database'];
$db = new db($constring, $config['username'], $config['password']);
if (!empty($_GET['serverID']) and !empty($_GET['lid'])) {
$res = $db->select($config['table'], "serverID = :id AND id > :lid ORDER BY `id` ASC", array('id' => $_GET['serverID'], 'lid' => $_GET['lid']));
$lid = -1;
foreach ($res as $key => $value) {
$lid = $value['id'];
}
print($lid . "\n");
foreach ($res as $key => $value) {
include('chatrow.php');
}
}elseif (empty($_GET['serverID'])) {
print("-1\n");
?>
> ServerID missing...<br />
<?php
}elseif (empty($_GET['lid'])) {
print("-1\n");
?>
> Latest ID missing...<br />
<?php
}
?>