php define BasePath _SERVER DOCUMENT_ROOT include_once BasePath data P

 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
<?php
define('BasePath', $_SERVER['DOCUMENT_ROOT']);
include_once(BasePath.'/data/Plugins/document.php');
include_once(BasePAth.'/codes/pagination.php');
H ('Гостевая');
$db = DB::$dbs;
/*
$paginator = new Pagination(array(
'page' => isset($_GET['page']) ? (int) $_GET['page'] : 1,
'num' => 10,
'posts' => $db->query('SELECT `id` FROM `guest`')->rowCount()
));
*/
$query = $db -> query('SELECT * FROM `guest` ORDER BY `id` DESC LIMIT '.$paginator->start.', '.$paginator->num);
?>
<div class="menu2"><?=hi($us);?></div>
<div style="padding: 10px; background-color: #ddd; border: 1px solid #ddd;">
<form method="POST">
<p><textarea name="message"></textarea></p>
<input type="submit" name="btn" value="Написать">
</form>
</div>
<?php
if ($query -> rowCount())
{
?>
Read nine records
<?php
}
else
{
?>
<div class="error">Сообщений пока нет!</div>
<?php
}
require_once('system/footer.php');
?>