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=\"Ошибка\" ontimer=\"index.php?ref=$ref\"><timer value=\"15\"/>";
echo "<p align=\"center\"><small>";
echo "Юзер не найден!";
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=\"Ошибка\" ontimer=\"index.php?ref=$ref\"><timer value=\"15\"/>";
echo "<p align=\"center\"><small>";
echo "Не верное сочетание ника и пароля!";
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&ps=$ps&ref=$ref\">Прихожая</a><br/>";
?>
</p>
</card>
</wml>
<?
mysql_close($link);
?>