Просмотр файла forum/index.php

Размер файла: 6.85Kb
<?

require "consts.php";

require "incl.php";

$agent=$HTTP_USER_AGENT;
$conn=mysql_connect(my_host, my_user, my_password);
mysql_select_db(my_db, $conn);
header("Cache-Control: no-cache");




header("Content-Type: text/vnd.wap.wml; charset=utf-8");
echo '<?xml version="1.0" encoding="utf-8"?>';
echo '<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">';









if(isset($HTTP_GET_VARS['UIN']))
{
$UIN=$HTTP_GET_VARS['UIN'];
}
else
{
$UIN="Guest";
}


if(isset($HTTP_GET_VARS['pass']))
{
$pass=$HTTP_GET_VARS['pass'];
}
else
{
$pass="Guest";
}
$UINmd5=$UIN;


$sql="select pass from users where id='$UIN'";
$res=mysql_query($sql);
$row=mysql_fetch_object($res);
if ($pass!=$row->pass)
{
$UIN="Guest";
}





$sql1="select id from forum where room='1'";
$result1=mysql_query($sql1);
$n11=0;
$n22=0;
$n33=0;
$n44=0;
$n55=0;
$n66=0;
$n77=0;
$n88=0;
$n99=0;
$n100=0;
$n110=0;
$n222=0;
$n120=0;
$n130=0;
$n140=0;
while ($row1=mysql_fetch_object($result1))
    {
    $n11=$n11+1;
    }
$sql2="select id from forum where room='2'";
$result2=mysql_query($sql2);
while ($row2=mysql_fetch_object($result2))
    {
    $n222=$n222+1;
    }
$sql3="select id from forum where room='3'";
$result3=mysql_query($sql3);
while ($row3=mysql_fetch_object($result3))
    {
    $n33=$n33+1;
    }
$sql4="select id from forum where room='4'";
$result4=mysql_query($sql4);
while ($row4=mysql_fetch_object($result4))
    {
    $n44=$n44+1;
    }
    $sql5="select id from forum where room='5'";
$result5=mysql_query($sql5);
while ($row5=mysql_fetch_object($result5))
    {
    $n55=$n55+1;
    }
$sql6="select id from forum where room='6'";
$result6=mysql_query($sql6);
while ($row6=mysql_fetch_object($result6))
    {
    $n66=$n66+1;
    }
$sql7="select id from forum where room='7'";
$result7=mysql_query($sql7);
while ($row7=mysql_fetch_object($result7))
    {
    $n77=$n77+1;
    }
$sql8="select id from forum where room='8'";
$result8=mysql_query($sql8);
while ($row8=mysql_fetch_object($result8))
    {
    $n88=$n88+1;
    }
$sql9="select id from forum where room='9'";
$result9=mysql_query($sql9);
while ($row9=mysql_fetch_object($result9))
    {
    $n99=$n99+1;
    }
$sql10="select id from forum where room='10'";
$result10=mysql_query($sql10);
while ($row10=mysql_fetch_object($result10))
    {
    $n100=$n100+1;
    }
$sql11="select id from forum where room='11'";
$result11=mysql_query($sql11);
while ($row11=mysql_fetch_object($result11))
    {
    $n110=$n110+1;
    }
$sql12="select id from forum where room='12'";
$result12=mysql_query($sql12);
while ($row12=mysql_fetch_object($result12))
    {
    $n120=$n120+1;
    }
$sql13="select id from forum where room='13'";
$result13=mysql_query($sql13);
while ($row13=mysql_fetch_object($result13))
    {
    $n130=$n130+1;
    }
$sql14="select id from forum where room='14'";
$result14=mysql_query($sql14);
while ($row14=mysql_fetch_object($result14))
    {
    $n140=$n140+1;
    }










$sql22="select * from rating";
$res22=mysql_query($sql22);
$n22=0;
while ($row22=mysql_fetch_object($res22))
{
$n22=$n22+1;
}
echo '<wml>';
echo '<head>';
echo '<meta http-equiv="Cache-Control" content="no-cache" forua="true"/>';
echo '</head>';
?>
<card id="who" title="&#x0424;&#x043E;&#x0440;&#x0443;&#x043C; (<?=$n22?>)">
<?
echo '<p>';




if ($UIN=="Guest")
{
?><small>&#x0427;&#x0442;&#x043E;&#x0431;&#x044B; &#x0434;&#x043E;&#x0431;&#x0430;&#x0432;&#x043B;&#x044F;&#x0442;&#x044C; &#x0442;&#x0435;&#x043C;&#x044B; &#x0438; &#x043E;&#x0442;&#x0432;&#x0435;&#x0447;&#x0430;&#x0442;&#x044C; &#x0432; &#x0444;&#x043E;&#x0440;&#x0443;&#x043C;&#x0435; &#x043D;&#x0435; &#x0437;&#x0430;&#x0431;&#x0443;&#x0434;&#x0442;&#x0435; &#x0430;&#x0432;&#x0442;&#x043E;&#x0440;&#x0438;&#x0437;&#x043E;&#x0432;&#x0430;&#x0442;&#x044C;&#x0441;&#x044F;!</small><br/><? 
echo '<small>Login:</small><br/>';
echo '<input type="text" title="login" maxlength="18" name="user" emptyok="false"/><br/>';
echo '<small>Password:</small><br/>';
echo '<input type="password" maxlength="15" title="Password" name="password" emptyok="false"/><br/>';
echo '<anchor title="Ok"><small>Ok</small>';
echo '<go method="post" href="login.php">';
echo '<postfield name="data1" value="$(user)"/>';
echo '<postfield name="data2" value="$(password)"/>';
echo '</go>';
echo '</anchor>';
echo '<br/>';
echo '<a href="registration.wml"><small>&#x0420;&#x0435;&#x0433;&#x0438;&#x0441;&#x0442;&#x0440;&#x0430;&#x0446;&#x0438;&#x044F;</small></a>';
     echo '<br/><br/>';

}
else
{
 echo '<br/>';
}



$n1=0;
$sql1="select id from rating where room='1'";
$result1=mysql_query($sql1);
while ($row1=mysql_fetch_object($result1))
    {
    $n1=$n1+1;
    }
?><a href="main.php?UIN=<?=$UIN?>&amp;pass=<?=$pass?>&amp;room=1"><small>&#x0421;&#x0430;&#x0439;&#x0442;(<?
?><?=$n1?>) [<?=$n11?>]</small><? echo '</a><br/>';

echo '<small>-----------</small><br/>';
$n2=0;
$sql2="select id from rating where room='2'";
$result2=mysql_query($sql2);
while ($row2=mysql_fetch_object($result2))
    {

    $n2=$n2+1;

    }
?><a href="main.php?UIN=<?=$UINmd5?>&amp;pass=<?=$pass?>&amp;room=2"><small>&#x041E;&#x0431;&#x0441;&#x0443;&#x0436;&#x0434;&#x0435;&#x043D;&#x0438;&#x0435; (<?
?><?=$n2?>) [<?=$n222?>]</small><? echo '</a><br/>';

echo '<small>-----------</small><br/>';
$n11=0;
$sql11="select id from rating where room='11'";
$result11=mysql_query($sql11);
while ($row11=mysql_fetch_object($result11))
    {

    $n11=$n11+1;

    }
?><a href="main.php?UIN=<?=$UINmd5?>&amp;pass=<?=$pass?>&amp;room=11"><small>&#x0412;&#x043E;&#x043F;&#x0440;&#x043E;&#x0441;&#x044B; (<?
?><?=$n11?>) [<?=$n110?>]</small><? echo '</a><br/>';

echo '<small>-----------</small><br/>';
$n14=0;
$sql14="select id from rating where room='14'";
$result14=mysql_query($sql14);
while ($row14=mysql_fetch_object($result14))
    {

    $n14=$n14+1;

    }
?><a href="main.php?UIN=<?=$UINmd5?>&amp;pass=<?=$pass?>&amp;room=14"><small>&#x041F;&#x0440;&#x0435;&#x0434;&#x043B;&#x043E;&#x0436;&#x0435;&#x043D;&#x0438;&#x044F; (<?
?><?=$n14?>) [<?=$n140?>]</small><? echo '</a><br/>';

echo '<small>-----------</small><br/>';
$n8=0;
$sql8="select id from rating where room='8'";
$result8=mysql_query($sql8);
while ($row8=mysql_fetch_object($result8))
    {


    $n8=$n8+1;

    }
?><a href="main.php?UIN=<?=$UINmd5?>&amp;pass=<?=$pass?>&amp;room=8"><small>&#x0424;&#x043B;&#x0435;&#x0439;&#x043C;  (<?
?><?=$n8?>) [<?=$n88?>]</small><? echo '</a><br/>';

echo '<small>-----------</small><br/>';
echo '<br/>';
?><a href="http://wap.all60.com?UIN=<?=$UIN?>&amp;pass=<?=$pass?>"><small>&#x0413;&#x043B;&#x0430;&#x0432;&#x043D;&#x0430;&#x044F;</small></a><br/><?

$dpoint=".";
$dpoint2=":";


$time2 =date(d);
$time2 .=$dpoint;
$time2 .=date(m);
$time2 .=$dpoint;
$time2 .=date(y);
$time2.= " - ";
$time2 .=date(H);
$time2.=$dpoint2;
$time2.=date(i);
$time2.=$dpoint2;
$time2 .=date(s);

$sql="update users set last='$time2' where id='$id'";
mysql_query($sql);
end_page(1);
echo '</p>';
echo '</card>';
?>
</wml>