include("params.php");
$form = "
";
if ($seenform != 'y')
print $form;
if ($name == "" or $topic == "" or $msg == "")
{
print "Заповніть всі поля, помічені зіркою (*)! Fill out all frames pointed with a star (*)! ";
$er = 1;
}
if (strlen($name) > $maxforname and $name != "")
{
print "Им`я не повинно перевищувати $maxforname символів!Name should't exceed $maxforname symbols! ";
$er = 1;
}
if (strlen($mail) > $maxformail and $mail != "")
{
print "E-mail не повинен перевищувати $maxformail символів!E-mail address should't exceed $maxformail symbols! ";
$er = 1;
}
if (strlen($url) > $maxforurl and $url != "")
{
print "Адреса сайта не повинна перевищувати $maxforurl символів! URL should't exceed $maxforurl symbols! ";
$er = 1;
}
if (strlen($topic) > $maxfortopic and $topic != "")
{
print "Тема не повинна перевищувати $maxfortopic символів!Theme should't exceed $maxfortopic symbols! ";
$er = 1;
}
if (strlen($msg) > $maxformsg and $msg != "")
{
print "Повідомлення не повинно перевищувати $maxformsg символів!A message should't exceed $maxformsg symbols! ";
$er = 1;
}
if (!eregi("^([0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-wyz][a-z](fo|g|l|m|mes|o|op|pa|ro|seum|t|u|v|z)?)$", $mail) and $mail != "")
{
print "Ви ввели некоректний E-mail адрес! You entered wrong E-mail address! ";
$er = 1;
}
$oldS = file("topics.dat");
for ($i=0;$i < sizeof($oldS);$i++)
{
list($oldfile,$olddate,$oldname,$oldmail,$oldurl,$oldtopic,$oldmsg) = split("::",$oldS[$i]);
if ($topic == $oldtopic)
{
print "Ця тема вже існує!This theme already exists! ";
$er = 1;
}
}
$f = $maxforword;
$e = explode(" ",$msg);
for ($a = 0; $a < sizeof($e); $a++)
{
$o = strlen($e[$a]);
}
if ($o > $maxforword)
{
print "Слова в повідомленні не повинні перевищувати $maxforword символів!The words in a message are't to exceed $maxforword symbols! ";
$er = 1;
}
if ($seenform == 'y' and $er == "")
{
$date = date("d-m-Y G-i-s");
srand((double)microtime()*1000000);
$file=uniqid(rand());
@touch("data/$file.dat");
chmod("data/$file.dat",0777);
$fo = @fopen("topics.dat","a");
$name = stripslashes($name);
$name = ereg_replace("<","<",$name);
$name = ereg_replace(">",">",$name);
$name = ereg_replace("::","::",$name);
$name = ereg_replace("::::","::::",$name);
$name = ereg_replace("::::::","::::::",$name);
$url = stripslashes($url);
$url = ereg_replace("<","<",$url);
$url = ereg_replace(">",">",$url);
$url = ereg_replace("::","::",$url);
$url = ereg_replace("::::","::::",$url);
$url = ereg_replace("::::::","::::::",$url);
$topic = stripslashes($topic);
$topic = ereg_replace("<","<",$topic);
$topic = ereg_replace(">",">",$topic);
$topic = ereg_replace("::","::",$topic);
$topic = ereg_replace("::::","::::",$topic);
$topic = ereg_replace("::::::","::::::",$topic);
$msg = stripslashes($msg);
$msg = ereg_replace("<","<",$msg);
$msg = ereg_replace(">",">",$msg);
$msg = ereg_replace("\r","",$msg);
$msg = ereg_replace("\n"," ",$msg);
$msg = ereg_replace("::","::",$msg);
$msg = ereg_replace("::::","::::",$msg);
$url = eregi_replace("http://","",$url);
$url = eregi_replace("http:","",$url);
$url = eregi_replace("http","",$url);
$url = ereg_replace("::","::",$url);
$url = ereg_replace("::::","::::",$url);
$mail = eregi_replace("mailto:","",$mail);
$mail = eregi_replace("mailto","",$mail);
$string = "$file::$date::$name::$mail::$url::$topic::$msg\r\n";
fputs($fo,$string);
fclose($fo);
print "Ваша тема створена! Перейдіть на список тем. ";
}
?>
|