Размер файла: 1.86Kb
<?php
include 'config.php';
include 'guestbook/mylib.php';
$ppp=20;
session_start();
$lang=$_GET['lang'];
# $p=htmlspecialchars(trim($_GET['p']),ENT_QUOTES);
# $cat=htmlspecialchars(trim($_GET['cat']),ENT_QUOTES);
# $action=htmlspecialchars(trim($_GET['action']),ENT_QUOTES);
# if ($_POST['id']!=0) $id=$_POST['id'];
# else $id=$_GET['id'];
# $id=htmlspecialchars(trim($_GET['id']),ENT_QUOTES);
$agent=$_SERVER['HTTP_USER_AGENT'];
$addr=$_SERVER['REMOTE_ADDR'];
list ($opname, $chatok) = check_op($_SERVER['REMOTE_ADDR']);
# $dayx=date("Y-m-d", mktime(0,0,0,date("m"), date("d")-3, date("Y")));
# $access=1;
# $getpath='/sorry.wml';
?>
<?php
if (!($conn=pg_connect("host=$dbhost port=$dbport dbname=$dbname user=$dbuser password=$dbpass")))
{
header("Content-type: text/vnd.wap.wml");
?>
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN" "http://www.wapforum.org/DTD/wml_1.2.dtd">
<wml>
<card id="CatalogErr" title="Ошибка">
<p align="center">
Ошибка подключения к БД<br/>
<a href="/">На главную</a>
</p>
</card>
</wml>
<?php
exit;
}
header("Content-type: text/vnd.wap.wml"); ?>
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN" "http://www.wapforum.org/DTD/wml_1.2.dtd">
<wml> <?php
print "<card id=\"Tags\" title=\"Tags\">\n";
print "<p align=\"center\">\n";
$res=pg_query($conn,"select distinct tag from chat_tags;");
$rows=pg_numrows($res);
for ($i=0;$i<$rows;$i++) {
$tag=pg_result($res,$i,0);
print "/".$tag;
if ($i<$rows-1) print "<br/>\n";
}
pg_close($conn);
print "</p>\n";
print "</card>\n";
print "</wml>\n";
?>