Просмотр файла parkerforum2/edit.php

Размер файла: 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>
&nbsp;&nbsp;Дата:<BR>
&nbsp;&nbsp;<input name=date type=text value=$Date><BR>
&nbsp;&nbsp;Автор:<BR>
&nbsp;&nbsp;<input name=author type=text value=$Author><BR>
&nbsp;&nbsp;E-mail:<BR>
&nbsp;&nbsp;<input name=mail type=text value=$Mail><BR>
&nbsp;&nbsp;ICQ:<BR>
&nbsp;&nbsp;<input name=icq type=text value=$Icq><BR>
&nbsp;&nbsp;Сайт:<BR>
&nbsp;&nbsp;<input name=site type=text value=$Site><BR>
&nbsp;&nbsp;Тема:<BR>
&nbsp;&nbsp;<textarea name=topic cols=30 rows=1>$Topic</textarea><BR>
&nbsp;&nbsp;Сообщение:<BR>
&nbsp;&nbsp;<textarea name=msg cols=60 rows=15>$Msg</textarea><BR> <BR>
&nbsp;&nbsp;<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>
&nbsp;&nbsp;Дата:<BR>
&nbsp;&nbsp;<input name=date type=text value=$Date><BR>
&nbsp;&nbsp;IP:<BR>
&nbsp;&nbsp;<input name=ip type=text value=$Ip><BR>
&nbsp;&nbsp;Автор:<BR>
&nbsp;&nbsp;<input name=name type=text value=$Name><BR>
&nbsp;&nbsp;E-mail:<BR>
&nbsp;&nbsp;<input name=mail type=text value=$Mail><BR>
&nbsp;&nbsp;ICQ:<BR>
&nbsp;&nbsp;<input name=icq type=text value=$Icq><BR>
&nbsp;&nbsp;Сайт:<BR>
&nbsp;&nbsp;<input name=url type=text value=$Url><BR>
&nbsp;&nbsp;Сообщение:<BR>
&nbsp;&nbsp;<textarea name=msg cols=60 rows=15>$Msg</textarea><BR>
&nbsp;&nbsp;<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'>";
}
}
?>