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

Размер файла: 765B
  1. <html>
  2. <head>
  3. <title>Объявления</title>
  4. </head>
  5.  
  6. <body><center><b>0бъявления</b></center><small>
  7. <?php Error_Reporting(E_ALL & ~E_NOTICE);
  8. $files="news.txt";
  9. $max=10;
  10. if($autor=="")
  11. {$autor="администрация";}
  12. $news=substr($news,0,999);
  13. $autor=substr($autor,0,32);
  14. if ($news!="" && $autor!="")
  15. {
  16. $time=Date("m.d.Y");
  17. $new="\n<b>$time</b><br>
  18. $news<br>
  19. Автор:<b>$autor</b><BR>
  20. * * *<br>";
  21. $fp=fopen($files,"a+");
  22. $fw=fwrite($fp,$new);
  23. fclose($fp);
  24. }
  25. $lines=file($files);
  26. $a=count($lines);
  27. $u=$a-$max;
  28. for($i=$a; $i>=$u; $i--)
  29. { echo $lines[$i]; }
  30. ?>
  31. * * *<br/> <a href="new.php">Добавить (Opera Mini)</a><br/>
  32. <a href="http://cekc.wen9.com">на главную</a></small>
  33. </body></html>
  34.