View file ch/vstrechi.php

File size: 3.33Kb
<?
header('Cache-Control: no-store, no-cache, must-revalidate');	// HTTP/1.1
header ("Content-type:text/vnd.wap.wml; charset=utf-8");
$ref=rand(10000,1000000);
require("inc.php"); 

$link = @mysql_pconnect ($MySQL_Hostname, $MySQL_Username, $MySQL_Password)
					 or die ("<wml><card id=\"error\" title=\"error\">
<do type=\"prev\" label=\"Back\"><prev/></do><p align=\"center\"><small>Can not connect to MySQL</small></p>
</card></wml>");

	@mysql_select_db($MySQLDatabasename) or die ("<wml><card id=\"error\" title=\"error\">
<do type=\"prev\" label=\"Back\"><prev/></do><p align=\"center\"><small>error select the database...</small></p>
</card></wml>");

		$result = @mysql_query ("Select pass,user from users where id='".$id."' LIMIT 1;");

			if (mysql_affected_rows() == 0) {
			echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\" \"http://www.wapforum.org/DTD/wml12.dtd\">";
echo "<wml>";
echo "<card id=\"error\" title=\"&#x041E;&#x0448;&#x0438;&#x0431;&#x043A;&#x0430;\" ontimer=\"index.php?ref=$ref\"><timer value=\"15\"/>";
echo "<p align=\"center\"><small>";
echo "&#x042E;&#x0437;&#x0435;&#x0440; &#x043D;&#x0435; &#x043D;&#x0430;&#x0439;&#x0434;&#x0435;&#x043D;!";
echo "</small></p></card></wml>";
exit;
}

$row = mysql_fetch_array ($result);
if ($ps !== $row["pass"]){
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\" \"http://www.wapforum.org/DTD/wml12.dtd\">";
echo "<wml>";
echo "<card id=\"error\" title=\"&#x041E;&#x0448;&#x0438;&#x0431;&#x043A;&#x0430;\" ontimer=\"index.php?ref=$ref\"><timer value=\"15\"/>";
echo "<p align=\"center\"><small>";
echo "&#x041D;&#x0435; &#x0432;&#x0435;&#x0440;&#x043D;&#x043E;&#x0435; &#x0441;&#x043E;&#x0447;&#x0435;&#x0442;&#x0430;&#x043D;&#x0438;&#x0435; &#x043D;&#x0438;&#x043A;&#x0430; &#x0438; &#x043F;&#x0430;&#x0440;&#x043E;&#x043B;&#x044F;!";
echo "</small></p></card></wml>";
exit;
}

echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\" \"http://www.wapforum.org/DTD/wml12.dtd\">\n";
echo "<wml>\n";
echo "<card title=\"&#x412;&#x441;&#x442;&#x440;&#x435;&#x447;&#x438;\">\n";
echo "<p align=\"left\">\n";

switch($mod) {

case 'meet':
$q=@mysql_query("select title,content,organizatory,login from vstrechi where id='$mid';");
$arr=@mysql_fetch_array($q);
		echo "<u>Название:</u> ".$arr['title'];
		echo "<br/><u>Содержание:</u> ".$arr['content'];
		echo "<br/><u>Организаторы:</u> ".$arr['organizatory'];
		echo "<br/><u>Разместил:</u> ".$arr['login'];
		echo "<br/>";
break;


default:
$q=mysql_query("select id,title from vstrechi order by id desc;");
if (mysql_affected_rows() == 0) {
echo "&#x412;&#x441;&#x442;&#x440;&#x435;&#x447; &#x43D;&#x435;&#x442;(<br/>";
}
while($arr=mysql_fetch_array($q)) {
echo "<a href=\"vstrechi.php?id=$id&amp;ps=$ps&amp;mid=".$arr['id']."&amp;mod=meet&amp;ref=$ref\">".$arr['title']."</a><br/>"; 
}

}

echo "---<br/>";
if($mod) {
echo "<a href=\"vstrechi.php?id=$id&amp;ps=$ps&amp;ref=$ref\">&#x412;&#x441;&#x442;&#x440;&#x435;&#x447;&#x438;</a><br/>";
}


echo "<a href=\"enter.php?id=$id&amp;ps=$ps&amp;ref=$rand\">Прихожая</a><br/>";

?>
</p>
</card>
</wml>
<?
mysql_close($link);
?>