<?
Error_Reporting(E_ALL & ~E_NOTICE);
$brayz = "$REMOTE_ADDR ";
$u1=getenv('HTTP_USER_AGENT');
$ipad=strtok($u1,'/');
$zag="[форум]";
$currHour=date("H",time());
$currDate=date("dS F, Y", time());
$currTime=date("$currHour:i", time());
$currDate = str_replace("January","01",$currDate);
$currDate = str_replace("February","02",$currDate);
$currDate = str_replace("March","03",$currDate);
$currDate = str_replace("April","04",$currDate);
$currDate = str_replace("May","05",$currDate);
$currDate = str_replace("June","06",$currDate);
$currDate = str_replace("July","07",$currDate);
$currDate = str_replace("August","08",$currDate);
$currDate = str_replace("September","09",$currDate);
$currDate = str_replace("October","10",$currDate);
$currDate = str_replace("November","11",$currDate);
$currDate = str_replace("December","12",$currDate);
$text = @file("profil/$log.prof");
if ($text!=""){
$af = @implode("",@file("rek/$razd=$prazd.af"));
$af=trim($af);
$nt=trim($nt);
if($af==$nt) {$nt="";}
$udata = explode(":||:",$text[0]);
$provpar=trim($udata[1]);}
if($par!=$provpar) {$log=""; $nt="";}
if($log=="") {$nt="";}
$nt = htmlspecialchars(stripslashes($nt));
if($nt!=""){
$counter_array = file("rek/$razd=$prazd.tem");
$id = $counter_array[0]+1;
$fp = @fopen("rek/$razd=$prazd.tem","wb");
@fputs($fp,$id);
@fclose($fp);
$mes=$id;
$fp=fopen("rek/$razd=$prazd=$mes.sort","w"); ///////// cоздаём файлы
fputs($fp,"$mes \r\n");
fclose($fp);
chmod ("rek/$razd=$prazd=$mes.sort", 0777);
$nol=0;
$fp=fopen("rek/$razd=$prazd=$mes.mes","w"); ///////// cоздаём файлы
fputs($fp,"$nol \r\n");
fclose($fp);
chmod ("rek/$razd=$prazd=$mes.mes", 0777);
$fp=fopen("rek/$razd=$prazd.af","w"); ///////// cоздаём файлы
fputs($fp,"$nt \r\n");
fclose($fp);
chmod ("rek/$razd=$prazd.af", 0777);
$zap=":||:$mes:||:$nt:||:$currDate :||:$log:||:$mes";
$fp=fopen("rek/$razd=$prazd=$mes.kt","w"); ///////// cоздаём файлы
fputs($fp,"$zap \r\n");
fclose($fp);
chmod ("rek/$razd=$prazd=$mes.kt", 0777);
}
header("Content-type:text/vnd.wap.wml;charset=utf-8");
print "<?xml version=\"1.0\"?>
<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\" \"http://www.wapforum.org/DTD/wml12.dtd\">
<wml>
<card id=\"tes\" title=\"$zag\" ontimer=\"otvet.php?razd=$razd&prazd=$prazd&tem=$mes&log=$log&par=$par\" > ";
if($nt!=""){print"<p><timer value=\"5\"/>тема $nt создана...<br/>";} else{print"<p><timer value=\"900000\"/>произошла ошибка...";}
print"
</p>
</card>
</wml>";
?>