Просмотр файла jokemaster/system/texts.php

Размер файла: 1.74Kb
<?php if (isset($j)): if (isset($_POST['z'])): if (eregi("^([0-9a-z_-]+)$",$_POST['z'])): $z=$_POST['z']; $da=date("Y-m-d_H-i"); $at=$da.'_'; $at.=$z; $at2=$at.'.av'; $n=2; while (file_exists("archives/$at2")): $at.='_'.$n; $at2=$at.'.av'; $n++; endwhile; $at=$at2; $e="$z\n\n"; while (list($key,$val)=each($_POST)): $val=htmlspecialchars(chop($val)); $val=str_replace("\n",' ',$val); $val=str_replace(':x',': x',$val); if (ereg("x[0-9]{3}",$key)): $e.=':'.$key."\n|".$val."\n\n"; endif; endwhile; $lod=fopen("archives/$at","w+"); fwrite($lod,$e); fclose($lod); else: print "<p align='left'><b>Ошибка! Передан неверный параметр!</b></p><br>"; endif; elseif (isset($_GET['at'])): $pu='archives'; $gor=opq($pu); $om=sizeof($gor)-1; if ($om<0): print '<p align="left"><b>Нет ни одной записи в архиве!</b></p><br>'; else: $rnd=rand(0,$om); if (eregi("^([0-9a-z_-]+)$",$_GET['at'])): $at2=$_GET['at'].'.av'; if (file_exists("archives/$at2")): $at=$at2; else: $at=$gor[$rnd]; endif; else: $at=$gor[$rnd]; endif; $lod=fopen("archives/$at","r"); $e=fread($lod,filesize("archives/$at")); fclose($lod); endif; endif; if (isset($e)): $e=split("\n\n",$e); $a1=array(); $a2=array(); $b=1; while (isset($e[$b])): $r=split("\n\|",$e[$b]); if (sizeof($r)==2): array_push($a1,$r[0]); array_push($a2,$r[1]); else: break; print "<p align='left'><b>Фатальная ошибка!</b></p><br>"; endif; $b++; endwhile; $q=$e[0].'.pg'; $jab=mas($q); if (sizeof($jab)==2): $e=str_replace($a1,$a2,$jab[1]); print "<p align='center'>$e</p><br>"; else: print "<p align='left'><b>Ошибка! Файла не существует или он некорректно записан.</b></p><br>"; endif; endif; else: header("Location: index.php"); endif; ?>