Файл: user/anketa/interest.php
Строк: 118
<?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';
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('Изменения успешно приняты');
}
}
err();
aut();
echo "<div class = 'tabs'>";
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='tabcontent' action='?$passgen'>n";
echo "<div class='f8'>Любимая музыка: <br /><input type='text' name='ank_music' value='" . output_text($user['ank_music'], false) . "' maxlength='32' /><br />";
echo "Любимые фильмы:<br /><input type='text' name='ank_films' value='" . output_text($user['ank_films'], false) . "' maxlength='32' /><br />";
echo "Любимые книги:<br /><input type='text' name='ank_books' value='" . output_text($user['ank_books'], false) . "' maxlength='32' /><br />";
echo "Любимое блюдо:<br /><input type='text' name='ank_course' value='" . output_text($user['ank_course'], false) . "' maxlength='32' /><br />";
echo "Увлечения:<br /><input type='text' name='ank_passion' value='" . output_text($user['ank_passion'], false) . "' maxlength='32' /><br />";
echo "</div><div class = 'f8'>";
echo "<button name = 'save' class = 'btn'>";
echo "<img src = '/style/icons/ok.png' /> Сохранить изменения";
echo "</button></div></form><div class='foot'>";
echo "<a href='/user/anketa/?name=" . $user['nick'] . "'>Посмотреть анкету</a>";
echo "</div>n";
require_once '../../sys/inc/tfoot.php';