i()['battle'] > 0) {
header('Location: /fbattle.php');
die();
}
if ($_POST['submit']) {
$name = filter_input(INPUT_POST, $_POST['name']);
$color = filter_input(INPUT_POST, $_POST['color']);
// $name = htmlspecialchars($_POST['name'], NULL, 'cp1251');
// $color = htmlspecialchars($_POST['color'], NULL, 'cp1251');
$hobbie = str_replace("\\n", "
", $_POST['hobbie']);
$hobbie = str_replace("\\r", "", $_POST['hobbie']);
$hobbie = str_replace("<br />", "
", $_POST['hobbie']);
$simbolcount = strlen($hobbie);
switch ($color) {
case 1: $color = 'blue'; break;
case 2: $color = 'green'; break;
default: $color = 'black'; break;
}
if ($simbolcount > 1500) {
err('Максимальная длинна поля Хобби: 1500 символов!');
} else {
db::c()->query('UPDATE `users` SET `realname` = "?s", `color` = "?s", `info` = "?s" WHERE `id` = ?i', $name, $color, $hobbie, $u->i()['id']);
}
}
?>