Анкета и игровая шапка.
This commit is contained in:
+8
-14
@@ -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("<br />", "<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("<br />", "<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>
|
||||
|
||||
Reference in New Issue
Block a user