Файл: social12/chat/umnik2.php
Строк: 16
<?php
$b = mysql_fetch_array(mysql_query("SELECT * FROM `vopros` WHERE `ids` = '1' LIMIT 1"));
$nom = $b['number'];
$vr = $b['time'];
$answ = $b['answer'];
$amsg = rus_to_k($msg);
$tran = $b['tran'];
$amsg = preg_replace('/$amsg/ui', "mb_strtolower('$1', 'UTF8')", $amsg);
if (($msg == $answ || $tran == $amsg) && $nom != 5) {
$st = time();
$st = $st + 20;
mysql_query("UPDATE `vopros` SET `number` = '5', `time` = '$st', `answer` = ' ', `tran` = ' ' WHERE `ids` = '1' LIMIT 1");
$user['credits']++;
mysql_query("UPDATE `users` SET `credits` = '$user[credits]' WHERE `id` = '$user[id]' LIMIT 1");
$creditss1 = $user['credits'];
$mes = 'Молодец <b>' . cvetnik($user['id']) . '</b>!<br/>Ответ: <b>' . $answ . '</b>
<br/>Это твой ' . $creditss1 . '-й правильный ответ!<br/>
Следующий вопрос через 20 сек.';
$ids = mt_rand(100000, 999999);
mysql_query("INSERT INTO `message` SET
`id` = '$ids',
`user` = 'Умник',
`who` = '0',
`time` = '" . time() . "',
`msg` = '$mes',
`room` = '$rm'");
}
?>