Граб работает нормально,но меня интересует вопрос по оптимизации кода и по защите
<?php
define('_IN_JOHNCMS', 1);
$headmod = 'mainpage';
require('../incfiles/core.php');
require('../incfiles/head.php');
error_reporting(0);
$file=file_get_contents("http://wap4u.ru/referat/index.php?mas=829&".$_SERVER['QUERY_STRING'], false );
if($file){
echo "<b>Рефераты</b><br /><br />";
$file=preg_replace('/(.*?)<div class="menu1">/si','',$file);
$file=preg_replace('/<div class="rek">(.*?)<div class="waplog">/si','',$file);
$file=str_replace('<br/>
<br/>
<br/>','<br/><br/>', $file);
$file = str_replace('<a href="http://wap4u.ru/">', '<a href="/">', $file);
$file = str_replace('</div></div>', '</div>', $file);
$file = str_replace('<a href="http://waplog.net/ru/c.shtml?3457"><img src="http://c.waplog.net/ru/3458.cnt" alt="" /></a>', ' ', $file);
}else{$file='Сервис временно недоступен !!!';}
echo $file;
require('../incfiles/end.php');
?>