View file 4at2/ch/view_obiav.php

File size: 2.6Kb
<?
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;
}

$q=@mysql_query("select content,title,login from obiav where id='$mid' order by id desc;");
$arr=@mysql_fetch_array($q);
$title=$arr['title'];
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=\"$title\">\n";
echo "<p align=\"left\">\n";

		echo $arr['content'];
		echo "<br/><u>Разместил:</u> ".$arr['login'];
		echo "<br/>---";
		echo "<br/><a href=\"enter.php?id=$id&amp;ps=$ps&amp;ref=$ref\">Прихожая</a><br/>";
?>
</p>
</card>
</wml>
<?
mysql_close($link);
?>