<?
include_once 'sys/inc/start.php';
include_once 'sys/inc/compress.php';
include_once 'sys/inc/sess.php';
include_once 'sys/inc/home.php';
include_once 'sys/inc/settings.php';
include_once 'sys/inc/db_connect.php';
include_once 'sys/inc/ipua.php';
include_once 'sys/inc/fnc.php';
include_once 'sys/inc/user.php';
only_reg();
$set['title']='Update';
include_once 'sys/inc/thead.php';
if (isset($_POST['save'])){
if (isset($_POST['school']) && strlen2(esc(stripcslashes(htmlspecialchars($_POST['school']))))<=84)
{
$user['school']=esc(stripcslashes(htmlspecialchars($_POST['school'])));
mysql_query("UPDATE `user` SET `school` = '$user[school]' WHERE `id` = '$user[id]' LIMIT 1");
}else $err='It is neccesery to write less :)';

if (isset($_POST['univer']) && strlen2(esc(stripcslashes(htmlspecialchars($_POST['univer']))))<=84)
{
$user['univer']=esc(stripcslashes(htmlspecialchars($_POST['univer'])));
mysql_query("UPDATE `user` SET `univer` = '$user[univer]' WHERE `id` = '$user[id]' LIMIT 1");
}else $err='It is neccesery to write less :)';

if (!isset($err))msg('succesfully changed');
}
err();
aut();
echo "<form method='post' action='?'>\n";
echo "Secondary school:<br />\n<input type='text' name='school' value='$user[school]' maxlength='512' /><br />\n";

echo "University:<br />\n<input type='text' name='univer' value='$user[univer]' maxlength='512' /><br />\n";

echo "<input class='button' type='submit' name='save' value='Save' />\n";
echo "</form>\n";
echo "&raquo;<a href='/info.php?info'>View profile</a>";
include_once 'sys/inc/tfoot.php';
?>
