Просмотр файла katrinka.ru/tags.php

Размер файла: 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="&#x041E;&#x0448;&#x0438;&#x0431;&#x043A;&#x0430;">
<p align="center">
&#x041E;&#x0448;&#x0438;&#x0431;&#x043A;&#x0430; &#x043F;&#x043E;&#x0434;&#x043A;&#x043B;&#x044E;&#x0447;&#x0435;&#x043D;&#x0438;&#x044F; &#x043A; &#x0411;&#x0414<br/>
<a href="/">&#x041D;&#x0430; &#x0433;&#x043B;&#x0430;&#x0432;&#x043D;&#x0443;&#x044E;</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";
?>