Анкета и игровая шапка.

This commit is contained in:
lopar
2018-03-01 22:26:45 +02:00
parent 61b0ca565b
commit a97a29f87d
4 changed files with 48 additions and 220 deletions
+8 -14
View File
@@ -4,25 +4,21 @@ if (!isset($_SESSION['uid'])) {
header('Location: /index.php');
die();
}
include('config.php');
include('functions.php');
$u = new u($_SESSION['uid']);
include_once('config.php');
include_once('functions.php');
if ($u->i()['battle'] > 0) {
header('Location: /fbattle.php');
die();
}
$name = filter_input(INPUT_POST, $_POST['name']);
$color = filter_input(INPUT_POST, $_POST['color']);
$hobbie = str_replace("\\n", "<br />", $_POST['hobbie']);
$hobbie = str_replace("\\r", "", $_POST['hobbie']);
$hobbie = str_replace("&lt;br&nbsp;/&gt;", "<br />", $_POST['hobbie']);
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", "<br />", $_POST['hobbie']);
$hobbie = str_replace("\\r", "", $_POST['hobbie']);
$hobbie = str_replace("&lt;br&nbsp;/&gt;", "<br />", $_POST['hobbie']);
if ($name || $color || $hobbie) {
$simbolcount = strlen($hobbie);
@@ -38,7 +34,6 @@ if ($_POST['submit']) {
db::c()->query('UPDATE `users` SET `realname` = "?s", `color` = "?s", `info` = "?s" WHERE `id` = ?i', $name, $color, $hobbie, $u->i()['id']);
}
}
?>
<!doctype html>
<html>
@@ -46,7 +41,6 @@ if ($_POST['submit']) {
<meta charset="utf-8"/>
<link rel="stylesheet" href="css/main.css">
<title>Анкета</title>
</head>
<body>
<a href="main.php">← на главную</a>