Файл: reg.php
Строк: 536
<?php
header("Cache-Control: no-cache");
if ($ver=="wml")header ("Content-type:text/vnd.wap.wml; charset=utf-8");
else header("Content-Type:text/html; charset=UTF-8");
require("inc.php");
$link = connect_db();
$brayz=strtok($_SERVER["HTTP_USER_AGENT"],'/');
$brayz = htmlentities(addslashes($brayz));
$setting = @mysql_query ("Select rus,reg from setting where klu4='1'");
$set = mysql_fetch_array ($setting);
$rus = $set["rus"];
$reg = $set["reg"];
mysql_query ("Select `klu4` from bannlist WHERE (ip = '".$REMOTE_ADDR."')and(soft = '".$HTTP_USER_AGENT."') LIMIT 1;");
if (mysql_affected_rows()!=0){
if ($ver=="wml"){
echo $xml;
echo $dtd;
echo "<wml>";
echo "<head><meta http-equiv="Cache-Control" content="no-cache" forua="true"/></head>";
echo "<card id="ban" title="Стоп!" ontimer="index.php?ver=$ver&ref=$ref"><timer value="30"/>";
echo "<p align="center">";
}else{
echo "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">";
echo "<html xmlns="http://www.w3.org/1999/xhtml">";
echo "<head><link rel="stylesheet" type="text/css" href="css/css.css"/>";
echo "<title>Стоп!</title>";
echo "<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head><body>";
echo "<div align="center">";
}
echo "<small>";
echo "Вы забанены по связке ip+soft!!!<br/>";
echo "</small>";
if ($ver=="wml")echo "</p></card></wml>";
else echo "</div></body></html>";
mysql_close($link);
exit;
}
if ($reg==0){
if ($ver=="wml"){
echo $xml;
echo $dtd;
echo "<wml>n";
echo "<head><meta http-equiv="Cache-Control" content="no-cache" forua="true"/></head>n";
echo "<card id="error" title="Профилактика" ontimer="index.php?ver=$ver&ref=$ref"><timer value="100"/>n";
echo "<p align="center">";
}else{
echo "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">";
echo "<html xmlns="http://www.w3.org/1999/xhtml">";
echo "<head><link rel="stylesheet" type="text/css" href="css/css.css"/>";
echo "<title>Ошибка</title>";
echo "<META HTTP-EQUIV="Refresh" CONTENT="10; URL=index.php?ver=$ver&ref=$ref">";
echo "<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head><body>";
echo "<div align="center">";
}
echo "<small>n";
echo "Регистрация временно приостановлена.<br/>";
echo "Попробуйте зарегистрироваться позже.<br/>";
echo "</small>n";
if ($ver=="wml")echo "</p></card></wml>n";
else echo "</div></body></html>n";
mysql_close($link);
exit;
}
if ($mod==="reghelp"){
if ($ver=="wml"){
echo $xml;
echo $dtd;
echo "<wml>n";
echo "<head><meta http-equiv="Cache-Control" content="no-cache" forua="true"/></head>n";
echo "<card id="help" title="Help">n";
echo "<do type="prev" label="Назад"><prev/></do>n";
echo "<p>n";
}else{
echo "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">";
echo "<html xmlns="http://www.w3.org/1999/xhtml">";
echo "<head><link rel="stylesheet" type="text/css" href="css/css.css"/>";
echo "<title>Стоп!</title>";
echo "<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head><body>";
echo "<div align="left">";
}
echo "<small>n";
if ($rus==1) echo "<b>Разрешено</b> в "нике" использовать только кирилицу и знаки латинского алфавита, цифры(кроме 0), а также символы: @, *, ), (, ?, !, -, ~, _, ], [, =.<br/>n";
else echo "<b>Разрешено</b> в "нике" использовать только знаки латинского алфавита и цифры(кроме 0), а также символы: @, *, ), (, ?, !, -, ~, _, ], [, =.<br/>n";
echo "<b>Разрешено</b> в пароле использовать только знаки латинского алфавита и цифры. Пароль не может быть короче четырёх символов.<br/>n";
if ($rus==1) echo "<b>Запрещено</b> использовать одновременно русские и латинские знаки.<br/>n";
echo "<b>Обязательно</b> вы должны заполнить все поля помеченные звездочкой.<br/>n";
echo "<b>Рекомендуем</b> после регистрации заполнить Свою анкету в Личном кабинете, так как при регистрации используется упрощённая форма.<br/>n";
echo "<b>Рекомендуем</b> заполнить поле Е-Mail. В случае если пароль был забыт, система вам его вышлет на данный адрес эл.почты<br/>n";
echo "</small>n";
if ($ver=="wml"){
echo "</p>n";
echo "<p align="center">n";
}else{
echo "</div>n";
echo "<div align="center">n";
}
echo "<small>n";
echo "<a href="reg.php?ver=$ver">Начать регистрацию!</a><br/>---<br/>n";
echo "<a href="index.php?ver=$ver">← Назад</a>n";
echo "</small>n";
if ($ver=="wml")echo "</p></card></wml>n";
else echo "</div></body></html>n";
exit;
}
if((empty($mod))||($mod!=="reghelp")){
if(!@$go){
$code = '';
$code .= rand(0, 9);
$code .= rand(0, 9);
$code .= rand(0, 9);
$code .= rand(0, 9);
$fo = @fopen('regcodeimg.reg', 'w+');
@fputs($fo, $code);
@fclose($fo);
if ($ver=="wml"){
echo $xml;
echo $dtd;
echo "<wml>n";
echo "<head><meta http-equiv="Cache-Control" content="no-cache" forua="true"/></head>n";
echo "<card id="reg" title="Регистрация">n";
echo "<p align="center" mode="wrap">n";
}else{
echo "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">";
echo "<html xmlns="http://www.w3.org/1999/xhtml">";
echo "<head><link rel="stylesheet" type="text/css" href="css/css.css"/>";
echo "<title>Регистрация</title>";
echo "<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head><body>";
echo "<div align="center">";
echo "<form method="POST" action="reg.php?ver=$ver&go=reg" name="auth">n";
}
echo "<small><b>*- обязательные поля!</b><br/>*Желаемый ник:</small><br/>n";
echo "<input name="user" maxlength="12" title="nick" emptyok="false"/><br/>n";
echo "<small>*Пароль:</small><br/>n";
echo "<input name="pass" maxlength="20" title="pass" emptyok="false"/><br/>n";
echo "<small>*Повторите пароль:</small><br/>n";
echo "<input name="pass2" maxlength="20" title="verpass" emptyok="false"/><br/>n";
echo "<small>*Ваше имя:</small><br/>n";
echo "<input name="name" maxlength="15" title="name" emptyok="false"/><br/>n";
echo "<small>Пол:</small><br/>n";
echo "<select name="sex">n";
echo "<option value="М">М</option>n";
echo "<option value="Ж">Ж</option>n";
echo "</select><br/>n";
echo "<small>*Дата рождения:</small><br/>n";
echo "<input size="2" name="day" maxlength="2" format="*N"/><small>-</small><input size="2" name="month" maxlength="2" format="*N"/><small>-</small><input size="4" name="year" maxlength="4" format="*N" emptyok="false"/><br/>n";
echo "<small>E-mail:</small><br/>n";
echo "<input name="mail" maxlength="70" title="mail" emptyok="true"/><br/>n";
echo "<small>*О себе:</small><br/>n";
echo "<input name="infa" maxlength="200" title="infa" emptyok="false"/><br/>n";
echo "<small>Транслитерация:</small><br/>n";
echo "<select name="trun">n";
echo "<option value="0">Нет</option>n";
echo "<option value="1">Да</option>n";
echo "</select><br/>n";
echo "<img src="regimg.php" alt="code"/><br/>n";
echo "<small>*Код на картинке:</small><br/>n";
echo "<input type="text" name="code" size="4" maxlength="4" format="*N" title="code"/><br/>n";
if ($ver=="wml"){
echo "<small><anchor title="go">OK!<go href="reg.php?ver=$ver&go=reg" method="post">n";
echo "<postfield name="user" value="$(user)"/>n";
echo "<postfield name="pass" value="$(pass)"/>n";
echo "<postfield name="pass2" value="$(pass2)"/>n";
echo "<postfield name="name" value="$(name)"/>n";
echo "<postfield name="sex" value="$(sex)"/>n";
echo "<postfield name="day" value="$(day)"/>n";
echo "<postfield name="month" value="$(month)"/>n";
echo "<postfield name="year" value="$(year)"/>n";
echo "<postfield name="mail" value="$(mail)"/>n";
echo "<postfield name="infa" value="$(infa)"/>n";
echo "<postfield name="code" value="$(code)"/>n";
echo "<postfield name="trun" value="$(trun)"/>n";
echo "</go></anchor></small><br/>n";
}else{
echo "<input type=hidden name=kod value=$rand />n";
echo "<input type="submit" value="OK!" name="enter"><br/>n";
}
echo "<small>n";
echo "---<br/>n";
echo "<a href="index.php?ver=$ver">← Главная</a>n";
echo "</small>n";
if ($ver=="wml")echo "</p></card></wml>n";
else echo "</div></body></html>n";
exit;
}
$error = true;
if ($trun==1){
$name = trun_to_rus($name);
$city = trun_to_rus($city);
$infa = trun_to_rus($infa);
}
$user = trim(" $user ");
$user = ereg_replace(" +"," ",$user);
$pass = trim(" $pass ");
$pass = ereg_replace(" +"," ",$pass);
$name = trim(" $name ");
$name = ereg_replace(" +"," ",$name);
$day = trim(" $day ");
$day = ereg_replace(" +"," ",$day);
$month = trim(" $month ");
$month = ereg_replace(" +"," ",$month);
$year = trim(" $year ");
$year = ereg_replace(" +"," ",$year);
$mail = trim(" $mail ");
$mail = ereg_replace(" +"," ",$mail);
$infa = trim(" $infa ");
$infa = ereg_replace(" +"," ",$infa);
$infa=substr($infa,0,400);
$sex = trim(" $sex ");
$sex = eregi_replace("\[P!\]", "0", $sex);
if ($rus==1){
$bak = $user;
$bak = replace_rus($bak);
$help = "В нике цифры разрешено использовать только вместе со знаками латинского или русского алфавита.";
}else{
$help = "В нике цифры разрешено использовать только вместе со знаками латинского алфавита.";
}
$emp = "Не заполнены обязательные поля!";
$wrongdate = "Не верно указана дата рождения! 0на должна иметь формат дд-мм-гггг, и быть реальной =)";
$god=date("Y")-10;
if(ctype_digit($user)){$msg = "".$help."";}
elseif((!preg_match("!^[a-z1-9@\*\)\(\?\!\-_\]\[=~]+$!i",$user))&&(!preg_match("!^[1-9@\*\)\(\?\!\-_\]\|\[=~]+$!i",$bak))){$msg = "В нике обнаружены запрешенные знаки!";}
elseif ($user === ""){$msg = "".$emp."";}
elseif ($pass === ""){$msg = "".$emp."";}
elseif (strpos($user,"|")!==false){$msg = "В нике обнаружены запрешенные знаки!";}
elseif(!preg_match("!^[a-z0-9]+$!i",$pass)){$msg = "В пароле обнаружены запрешенные знаки!";}
elseif ($name == ""){$msg = "".$emp."";}
elseif ($day == ""){$msg = "".$emp."";}
elseif ($month == ""){$msg = "".$emp."";}
elseif ($year == ""){$msg = "".$emp."";}
elseif (strlen($pass) < 4){$msg = "Пароль не должен быть короче четырёх символов!";}
elseif (strlen($user) < 4) {$msg = "Ник не должен содержать менее 4-ёх знаков!";}
elseif ((strlen($day) !== 2)||($day>31)){$msg = "".$wrongdate."";}
elseif ((strlen($month) !== 2)||($month>12)){$msg = "".$wrongdate."";}
elseif ((strlen($year) !== 4)||($year>=$god)||($year<1950)){$msg = "".$wrongdate."";}
elseif ($pass !== $pass2){$msg = "пароли не совпадают!";}
elseif ($code==""){$msg = "Вы не ввели код с картинки!";}
elseif (($sex == "")&&($sex !== "М")&&($sex !== "Ж")){$msg = "Не верно указан пол";}
else
{
$user = HtmlSpecialChars($user);
$pass = HtmlSpecialChars($pass);
$name = HtmlSpecialChars($name);
$day = HtmlSpecialChars($day);
$month = HtmlSpecialChars($month);
$year = HtmlSpecialChars($year);
$infa = HtmlSpecialChars($infa);
$mob = HtmlSpecialChars($mob);
$sex = HtmlSpecialChars($sex);
$mail = HtmlSpecialChars($mail);
$mail = str_replace("", "", $mail);
$mail = str_replace("", "", $mail);
$mail = str_replace("", "", $mail);
$mail = str_replace("", "", $mail);
$mail = str_replace("", "", $mail);
$mail = str_replace("", "", $mail);
$user = str_replace("", "", $user);
$user = str_replace("", "", $user);
$user = str_replace("", "", $user);
$user = str_replace("", "", $user);
$user = str_replace("", "", $user);
$user = str_replace("", "", $user);
$pass = str_replace("", "", $pass);
$pass = str_replace("", "", $pass);
$pass = str_replace("", "", $pass);
$pass = str_replace("", "", $pass);
$pass = str_replace("", "", $pass);
$pass = str_replace("", "", $pass);
$name = str_replace("", "", $name);
$name = str_replace("", "", $name);
$name = str_replace("", "", $name);
$name = str_replace("", "", $name);
$name = str_replace("", "", $name);
$name = str_replace("", "", $name);
$infa = str_replace("", "", $infa);
$infa = str_replace("", "", $infa);
$infa = str_replace("", "", $infa);
$infa = str_replace("", "", $infa);
$infa = str_replace("", "", $infa);
$infa = str_replace("", "", $infa);
$mob = str_replace("", "", $mob);
$mob = str_replace("", "", $mob);
$mob = str_replace("", "", $mob);
$mob = str_replace("", "", $mob);
$mob = str_replace("", "", $mob);
$mob = str_replace("", "", $mob);
////////////////////////////////////////////////
$sex = str_replace("", "", $sex);
$sex = str_replace("", "", $sex);
$sex = str_replace("", "", $sex);
$sex = str_replace("", "", $sex);
$sex = str_replace("", "", $sex);
$sex = str_replace("", "", $sex);
////////////////////////////////////////////////
$mail = str_replace("$", "$$", $mail);
$mail = str_replace("|", "¦", $mail);
$user = str_replace("$", "$$", $user);
$user = str_replace("|", "¦", $user);
$pass = str_replace("$", "$$", $pass);
$pass = str_replace("|", "¦", $pass);
$name = str_replace("$", "$$", $name);
$name = str_replace("|", "¦", $name);
$day = str_replace("$", "$$", $day);
$day = str_replace("|", "¦", $day);
$month = str_replace("$", "$$", $month);
$month = str_replace("|", "¦", $month);
$year = str_replace("$", "$$", $year);
$year = str_replace("|", "¦", $year);
$infa = str_replace("$", "$$", $infa);
$infa = str_replace("|", "¦", $infa);
$name = str_replace("'", "‘", $name);
$day = str_replace("'", "‘", $day);
$month = str_replace("'", "‘", $month);
$year = str_replace("'", "‘", $year);
$city = str_replace("'", "‘", $city);
$infa = str_replace("'", "‘", $infa);
$sex = str_replace("'", "‘", $sex);
$sex = str_replace("$", "$$", $sex);
$sex = str_replace("|", "¦", $sex);
if (!eregi("^[a-z0-9._-]+@[a-z0-9._-]+.[a-z]{2,4}$", $mail))$mail="";
$open=fopen("log/bannlist.dat","r");
while(!feof($open)) @$search.=fgets($open,1024);
fclose($open);
$nick = $user;
$nick = str_replace("*", "№1", $nick);
$nick = str_replace(")", "№2", $nick);
$nick = str_replace("(", "№3", $nick);
$nick = str_replace("?", "№4", $nick);
$nick = str_replace("]", "№5", $nick);
$nick = str_replace("[", "№6", $nick);
$search = str_replace("*", "№1", $search);
$search = str_replace(")", "№2", $search);
$search = str_replace("(", "№3", $search);
$search = str_replace("?", "№4", $search);
$search = str_replace("]", "№5", $search);
$search = str_replace("[", "№6", $search);
if(eregi(strtolower("#$nick#"),strtolower($search))){
$code = '';
$code .= rand(0, 9);
$code .= rand(0, 9);
$code .= rand(0, 9);
$code .= rand(0, 9);
$fo = @fopen('regcodeimg.reg', 'w+');
@fputs($fo, $code);
@fclose($fo);
echo $xml;
echo $dtd;
echo "<wml>n";
echo "<card id="error" title="Ошибка" ontimer="reg.php?ver=$ver"><timer value="10"/>n";
echo "<p>n";
echo "Этот ник забанен!n";
if ($ver=="wml")echo "</p></card></wml>n";
else echo "</div></body></html>n";
exit;
}
if(@file_get_contents('regcodeimg.reg') != intval($_POST['code'])){
$code = '';
$code .= rand(0, 9);
$code .= rand(0, 9);
$code .= rand(0, 9);
$code .= rand(0, 9);
$fo = @fopen('regcodeimg.reg', 'w+');
@fputs($fo, $code);
@fclose($fo);
echo "<?xml version="1.0" encoding="UTF-8"?>n";
echo "<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN" "http://www.wapforum.org/DTD/wml12.dtd">n";
echo "<wml>n";
echo "<card id="error" title="Ошибка" ontimer="reg.php"><timer value="10"/>n";
echo "<p>n";
echo "<small>n";
echo "Код с картинки введен не верно!n";
echo "</small>n";
echo "</p>n";
echo "</card>n";
echo "</wml>n";
exit; }
$ruser = rus_to_k($user);
$latuser=strtolower($user);
mysql_query ("select * from users where ruser = '".$ruser."'");
if (mysql_affected_rows()==0) $est = false; else if ($ruser!=$user) $est = true;
$result = mysql_query ("Select * from users where latuser = '".$latuser."'");
if ((mysql_affected_rows() == 0)&&($est==false)) {
$levelselect = @mysql_query ("Select name from levels where level=0");
$levels = @mysql_fetch_array($levelselect);
$lev0 = $levels["name"];
$birth = "$day-$month-$year";
$now = date("d-m-Y");
if (strlen($ruser)<13)
if ($ruser!=$user)$ins_str = "Insert into users set id = '".$id."', user='".$user."', pass='".$pass."', name='".$name."', sex='".$sex."', birth='".$birth."', infa='".$infa."', date='".$now."', mail='".$mail."', ruser = '".$ruser."', user_ip='".$REMOTE_ADDR."', user_soft = '".$HTTP_USER_AGENT."', status = '".$lev0."'";
else $ins_str = "Insert into users set id = '".$id."', user='".$user."', pass='".$pass."', name='".$name."', sex='".$sex."', birth='".$birth."', infa='".$infa."', date='".$now."', mail='".$mail."', latuser = '".$latuser."', user_ip='".$REMOTE_ADDR."', user_soft = '".$HTTP_USER_AGENT."', status = '".$lev0."'";
if (mysql_query ($ins_str)) {
$id=mysql_insert_id();
$msg = "Вы успешно зарегистрированы!";
@mysql_query("OPTIMIZE TABLE users");
@mysql_query("ANALYZE TABLE users");
$error = False;
} else {
$msg = " ".mysql_error()." ";
}
} else {
$msg = "Указанный вам ник "$user" уже занят, выберите другой";
}
}
if ($error) {
$code = '';
$code .= rand(0, 9);
$code .= rand(0, 9);
$code .= rand(0, 9);
$code .= rand(0, 9);
$fo = @fopen('regcodeimg.reg', 'w+');
@fputs($fo, $code);
@fclose($fo);
if ($ver=="wml"){
echo $xml;
echo $dtd;
echo "<wml>n";
echo "<head><meta http-equiv="Cache-Control" content="no-cache" forua="true"/></head>n";
echo "<card id="error" title="Ошибка" ontimer="reg.php?ver=$ver&ref=$ref"><timer value="15"/>n";
echo "<p align="center">n";
}else{
echo "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">";
echo "<html xmlns="http://www.w3.org/1999/xhtml">";
echo "<head><link rel="stylesheet" type="text/css" href="css/css.css"/>";
echo "<title>Ошибка</title>";
echo "<META HTTP-EQUIV="Refresh" CONTENT="2; URL=reg.php?ver=$ver&ref=$ref">";
echo "<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head><body>";
echo "<div align="center">";
}
echo "<small>n";
echo "$msg<br/>n";
echo "</small>n";
if ($ver=="wml")echo "</p></card></wml>n";
else echo "</div></body></html>n";
} else {
$ref=rand(10000,1000000);
$time=time();
$ref=rand(10000,1000000);
$code = '';
$code .= rand(0, 9);
$code .= rand(0, 9);
$code .= rand(0, 9);
$code .= rand(0, 9);
$fo = @fopen('regcodeimg.reg', 'w+');
@fputs($fo, $code);
@fclose($fo);
if ($ver=="wml"){
echo $xml;
echo $dtd;
echo "<wml>n";
echo "<head><meta http-equiv="Cache-Control" content="no-cache" forua="true"/></head>n";
echo "<card id="ok" title="OK">n";
echo "<p align="center">n";
}else{
echo "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">";
echo "<html xmlns="http://www.w3.org/1999/xhtml">";
echo "<head><link rel="stylesheet" type="text/css" href="css/css.css"/>";
echo "<title>ОК</title>";
echo "<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head><body>";
echo "<div align="center">";
}
echo "<small>n";
echo "".$msg."<br/><br/>n";
echo "Ваш ник:n";
echo "<b>".$user."</b><br/>n";
echo "Ваш ID:n";
echo "<b>".$id."</b><br/>n";
echo "Пароль:n";
echo "<b>".$pass."</b><br/><br/>n";
echo "<a href="enter.php?ver=$ver&id=$id&ps=$pass&ref=$ref">В чат!</a><br/>n";
echo "<a href="index.php?ver=$ver">← Главная</a>n";
echo "</small>n";
if ($ver=="wml")echo "</p></card></wml>n";
else echo "</div></body></html>n";
$adm = @mysql_query ("Select user from users where id='1' LIMIT 1;");
$z = @mysql_fetch_array ($adm);
$administration = $z["user"];
$administration = check($administration);
$data = date("d-M-Y [H:i]");
$kol = rand(0,99999999);
$time = time();
$topic = "Добро пожаловать!";
if($sex=='М'){
$message = "<b>".$user."</b>! Добро пожаловать в наш уютный 4ат! Всю интересующую информацию о правилах чата можешь найти и ознакомится в разделе FAQ. Желаем приятного общения!";
$new = "присоединился";
}else if($sex=='Ж'){
$message = "<b>".$user."</b>! Добро пожаловать в наш уютный 4ат! Всю интересующую информацию о правилах чата можешь найти и ознакомится в разделе FAQ. Желаем приятного общения!!!";
$new = "присоединилась";
}else{
$message = "Во избежание неприятностей укажите правильный пол.";
$new = "присоединилось лицо неопределённого пола и ориентации";
}
mysql_query("Insert into zapiski set klu4='".$kol."', who ='".$administration."', idwho ='1', message = '".$message."', towhom = '".$user."', idtowhom = '".$id."', time = '".$time."', readd = '0', topic = '".$topic."', date='".$data."'");
/////////////////////////
$rnd = rand(0,99999999);
$today=date ("H:i");
$time = time();
$txt = "<b>ВНИМАНИЕ!!!</b> Секунду назад Нас стало ещё больше. К Нашему семейству ".$new." <b>".$user."</b>!!! Встречайте и не обделяйте вниманием.";
for ($num = 0; $num <= 22; $num++){
$room = "room".$num;
mysql_query ("Insert into $room set klu4= '".$rnd."', time='".$today."', who='".$administration."', message='".$txt."', id='".$time."', towhom='', hid='0', usid='1', komu=''");
}
/////////////////////////////
}
mysql_close($link);
}
?>