1) { //$fp = fopen ('logs/ref_'.gmdate("d.m.Y").'.log', "a+"); $fp = @fopen ('logs/ref.txt', "a+"); @fwrite ($fp, gmdate("d.m.Y H:i:s")."\t".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']."\t".$_SERVER['HTTP_REFERER']."\t".$_SERVER["HTTP_USER_AGENT"]."\t".$_SERVER['REMOTE_ADDR']."\t".$url_redirect."\n"); @fclose ($fp); } else { //$fp = fopen ('logs/'.gmdate("d.m.Y").'.log', "a+"); $fp = @fopen ('logs/noref.txt', "a+"); @fwrite ($fp, gmdate("d.m.Y H:i:s")."\t".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']."\t".$_SERVER['HTTP_REFERER']."\t".$_SERVER["HTTP_USER_AGENT"]."\t".$_SERVER['REMOTE_ADDR']."\t".$url_redirect."\n"); @fclose ($fp); } $id=(int)trim($_GET[p]); if (is_int($id)==false) {unset($id);} if (file_exists('cache/'.$id.'.html')==false) {unset($id);} if ($id) { $tmp=file_get_contents('cache/'.$id.'.html'); $tmp=explode('|||',$tmp); $title=trim($tmp[0]); $content=trim($tmp[1]); } else { $title='404 error'; $content='404 error'; } ?>