Файл: user/anketa/interest.php
Строк: 126
<?php
require_once '../../sys/inc/start.php';
require_once '../../sys/inc/compress.php';
require_once '../../sys/inc/sess.php';
require_once '../../sys/inc/settings.php';
require_once '../../sys/inc/db_connect.php';
require_once '../../sys/inc/ipua.php';
require_once '../../sys/inc/fnc.php';
require_once '../../sys/inc/user.php';
only_reg();
$set['title'] = 'Интересы';
require_once '../../sys/inc/thead.php';
title();
if (isset($_POST['save'])) {
if (isset($_POST['ank_music']) && preg_match('#^([0,1-9 A-zА-я -]*)$#ui', $_POST['ank_music'])) {
$user['ank_music'] = htmlspecialchars(mysql_real_escape_string($_POST['ank_music']));
mysql_query("UPDATE `user` SET `ank_music` = '" . mysql_real_escape_string($user['ank_music']) . "' WHERE `id` = '$user[id]' LIMIT 1");
} else {
$err[] = 'Неверный формат любимая музыка';
}
if (isset($_POST['ank_films']) && preg_match('#^([0,1-9 A-zА-я -]*)$#ui', $_POST['ank_films'])) {
$user['ank_films'] = htmlspecialchars(mysql_real_escape_string($_POST['ank_films']));
mysql_query("UPDATE `user` SET `ank_films` = '" . mysql_real_escape_string($user['ank_films']) . "' WHERE `id` = '$user[id]' LIMIT 1");
} else {
$err[] = 'Неверный формат любимый фильм';
}
if (isset($_POST['ank_books']) && preg_match('#^([0,1-9 A-zА-я -]*)$#ui', $_POST['ank_books'])) {
$user['ank_books'] = htmlspecialchars(mysql_real_escape_string($_POST['ank_books']));
mysql_query("UPDATE `user` SET `ank_books` = '" . mysql_real_escape_string($user['ank_books']) . "' WHERE `id` = '$user[id]' LIMIT 1");
} else {
$err[] = 'Неверный формат любимые книги';
}
if (isset($_POST['ank_passion']) && preg_match('#^([0,1-9 A-zА-я -]*)$#ui', $_POST['ank_passion'])) {
$user['ank_passion'] = htmlspecialchars(mysql_real_escape_string($_POST['ank_passion']));
mysql_query("UPDATE `user` SET `ank_passion` = '" . mysql_real_escape_string($user['ank_passion']) . "' WHERE `id` = '$user[id]' LIMIT 1");
} else {
$err[] = 'Неверный формат увлечения';
}
if (isset($_POST['ank_course']) && preg_match('#^([0,1-9 A-zА-я -]*)$#ui', $_POST['ank_course'])) {
$user['ank_course'] = htmlspecialchars(mysql_real_escape_string($_POST['ank_course']));
mysql_query("UPDATE `user` SET `ank_course` = '" . mysql_real_escape_string($user['ank_course']) . "' WHERE `id` = '$user[id]' LIMIT 1");
} else {
$err[] = 'Неверный формат любимое блюдо';
}
if (!isset($err)) {
msg('Изменения успешно приняты');
header("Refresh: 1; url=/user/anketa/interes.php");
echo "<a href = '/user/anketa/interes.php'><div class = 'razd'>" . img('left.png') . " Назад</div></a>";
require_once '../../sys/inc/tfoot.php';
}
}
err();
aut();
echo "<div class = 'tabs t_bar clear_fix'>";
echo "<a href = 'setting.php'>Основное</a>";
echo "<a href = 'character_type.php'>Типаж</a>";
echo "<a href = 'interest.php' class = 'active'>Интересы</a>";
echo "<a href = 'dop.php'>Доп.</a>";
echo "<a href = 'connected.php'>Контакты</a>";
echo "</div>";
echo "<form method = 'post' class = 'razd' action = '?$passgen'>n";
echo "Любимая музыка: <br /><input type = 'text' name = 'ank_music' value = '" . text::toOutput($user['ank_music'], false) . "' maxlength = '32' /><br />";
echo "Любимые фильмы:<br /><input type = 'text' name = 'ank_films' value = '" . text::toOutput($user['ank_films'], false) . "' maxlength = '32' /><br />";
echo "Любимые книги:<br /><input type = 'text' name = 'ank_books' value = '" . text::toOutput($user['ank_books'], false) . "' maxlength = '32' /><br />";
echo "Любимое блюдо:<br /><input type = 'text' name = 'ank_course' value = '" . text::toOutput($user['ank_course'], false) . "' maxlength = '32' /><br />";
echo "Увлечения:<br /><input type = 'text' name = 'ank_passion' value = '" . text::toOutput($user['ank_passion'], false) . "' maxlength = '32' /><br />";
echo "<div class = 'hr'></div>";
echo "<button name = 'save' class = 'action'>";
echo "<span class = 'label'><span class = 'icon icon67' /> Сохранить</span>";
echo "</button></form><div class = 'razd'>";
echo "<a href = '/user/anketa/?name=" . $user['nick'] . "'>Посмотреть анкету</a>";
echo "</div>n";
require_once '../../sys/inc/tfoot.php';