File size: 866B
<?php
include 'config.php';
include 'smileandtegs.php';
if ($pass==$user_pass)
{
$page=$_POST['page'];
$str=$_POST['str'];
$otvet=$_POST['otvet'];
$file=file("./msg/$id.dat");
$editstr=trim($file[$str]);
$ex=explode('||', $editstr);
$name_user=trim($ex[0]);
$browser=trim($ex[1]);
$ip=trim($ex[2]);
$time=trim($ex[3]);
$msg=trim($ex[4]);
$otvet=htmlspecialchars($otvet);
$otvet=preg_replace("!(http://[\S]+)([\s]|$)!i","<a href=\"\\1\">\\1</a> ",$otvet);
$otvet=tegs($otvet);
$otvet=smile($otvet);
$buff=file_get_contents("./msg/$id.dat");
$buff=str_replace("$editstr","$name_user||$browser||$ip||$time||$msg||$otvet||",$buff);
$fileed=fopen("./msg/$id.dat","w");
fputs($fileed, $buff);
fclose($fileed);
}
$site='http://'.$_SERVER['HTTP_HOST'].''.str_replace('postotvet.php','index.php',$_SERVER['PHP_SELF']).'?id='.$id.'&page='.$page;
header ("Location: $site");
?>