View file wapp_antifront.com/news/index.php

File size: 1.76Kb
<?
include '../config.php';
$sg="$homepage";  //////////Ссылка на главную /////

header("Content-type:text/vnd.wap.wml;charset=utf-8");
print "<?xml version=\"1.0\"?>
<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">
<wml>
<card id=\"news\" title=\"&#x041D;&#x043E;&#x0432;&#x043E;&#x0441;&#x0442;&#x0438;\">
<p align=\"left\">
<br/>";
$user_agent_string    = getenv("HTTP_USER_AGENT");
$host                 = gethostbyaddr($REMOTE_ADDR);
$ip                   = $REMOTE_ADDR;
$date                 = date("d-m-Y",time());
$time                 = date('H:i:s',time());
$text = "$user_agent_string::$host::$date::$time::$ip";
$fp=fopen("counter.txt","a");
fputs($fp,"$text \r\n");
fclose($fp);

$file=file("news.txt");
$vn=count($file);
print "&#x0412;&#x0441;&#x0435;&#x0433;&#x043E; &#x043D;&#x043E;&#x0432;&#x043E;&#x0441;&#x0442;&#x0435;&#x0439;:<small> $vn</small>
<br/>
==========
<br/>
";
$const=5;
$xfile = @file("news.txt");
$endfile = count($xfile);
$obrat=5;
$obrat2=1;
$a=$a+$const;
if ($endfile<$a) {$g=$a-$endfile; $a=$a-$g;}
if ($a<5) {$a=5;}

for ($i=count($xfile)-$a;$i<count($xfile)-$a+5;$i++)
{ $obrat=$i+5;
  $obrat=$obrat-$obrat2;
  $obrat2=$obrat2+2;
  $udata = explode("::",$xfile[$obrat]);
  print "
<br/>$udata[0]<br/>$udata[1]<br/>----------";}      ////////// Разделитель
if ($a>count($xfile)) {$a=$a-10;}

if ($endfile>$a)
echo("<br/><a href=\"index.php?a=$a\">&#x0414;&#x0430;&#x043B;&#x0435;&#x0435;</a>");
if ($a>5)
 {$a=$a-10; echo("<br/><a href=\"index.php?a=$a\">&#x041D;&#x0430;&#x0437;&#x0430;&#x0434;</a>");}
print "
<br/>
<a href=\"$sg\"><a href=\"$sg\">&#x041D;&#x0430; &#x0433;&#x043B;&#x0430;&#x0432;&#x043D;&#x0443;&#x044E;</a></a></p>
</card>
</wml>";
?>