File size: 2.87Kb
<?
if(QUERY_STRING=="logged");
$logged=0;
session_start();
include"params.php";
if($epass==$pass and $elog==$log)
{
$logged=1;
}
if($object=="topic" and $line!="" and $logged==1)
{
$File=file("topics.dat");
list($Id,$Date,$Author,$Mail,$Icq,$Site,$Topic,$Msg)=split("::",$File[$line]);
print"
<form action=edit.php?object=topic&line=$line method=post>
<input type=hidden name=seenform value=y>
<input type=hidden name=id value=$Id>
Дата:<BR>
<input name=date type=text value=$Date><BR>
Автор:<BR>
<input name=author type=text value=$Author><BR>
E-mail:<BR>
<input name=mail type=text value=$Mail><BR>
ICQ:<BR>
<input name=icq type=text value=$Icq><BR>
Сайт:<BR>
<input name=site type=text value=$Site><BR>
Тема:<BR>
<textarea name=topic cols=30 rows=1>$Topic</textarea><BR>
Сообщение:<BR>
<textarea name=msg cols=60 rows=15>$Msg</textarea><BR> <BR>
<input type=submit value=Изменить!>
</form>";
if($seenform=='y' and $topic!="" and $date!="" and $author!="" and $icq!="" and $site!="" and $msg!="" and $id!="" and $mail!="" and $logged==1)
{
$File[$line]="$id::$date::$author::$mail::$icq::$site::$topic::$msg";
$file="";
foreach($File as $val) $file.=trim($val)."\r\n";
$_file=fopen("topics.dat", "w+");
fwrite($_file, "$file");
fclose($_file);
print "<meta http-equiv=refresh content='0; url=index.php'>";
}
}
if($object=="answer" and $line!="" and $logged==1 and $fileid!="")
{
$File=file("data/answers/$fileid.dat");
list($Date,$Name,$Mail,$Icq,$Url,$Msg,$Ip)=split("::",$File[$line]);
print"
<form action=edit.php?object=answer&line=$line&fileid=$fileid&Line=$Line&Page=$Page method=post>
<input type=hidden name=seenform value=y>
Дата:<BR>
<input name=date type=text value=$Date><BR>
IP:<BR>
<input name=ip type=text value=$Ip><BR>
Автор:<BR>
<input name=name type=text value=$Name><BR>
E-mail:<BR>
<input name=mail type=text value=$Mail><BR>
ICQ:<BR>
<input name=icq type=text value=$Icq><BR>
Сайт:<BR>
<input name=url type=text value=$Url><BR>
Сообщение:<BR>
<textarea name=msg cols=60 rows=15>$Msg</textarea><BR>
<input type=submit value=Изменить!>
</form>";
if($seenform=='y' and $date!="" and $name!="" and $icq!="" and $url!="" and $msg!="" and $ip!="" and $mail!="" and $logged==1)
{
$File[$line]="$date::$name::$mail::$icq::$url::$msg::$ip";
$file="";
foreach($File as $val) $file.=trim($val)."\r\n";
$_file=fopen("data/answers/$fileid.dat", "w+");
fwrite($_file, "$file");
fclose($_file);
print "<meta http-equiv=refresh content='0; url=showtopic.php?line=$Line&page=$Page'>";
}
}
?>