<?
echo "<div class=\"trow\">\n";
echo "<a href=\"/anketa.php\">Анкета</a> &gt; Пол<br />\n";
echo "</div>\n";

if (isset($_GET['set']))
{

if (isset($_POST['pol']) && ($_POST['pol']==1 || $_POST['pol']==0))
{
$user['pol']=$_POST['pol'];
mysql_query("UPDATE `user` SET `pol` = '$user[pol]' WHERE `id` = '$user[id]' LIMIT 1");
}
else $err='Ошибка выбора пола';

header ("Location: anketa.php?ok&".SID."");
exit;}
err();
aut();

echo "<form method=\"post\" action=\"anketa.php?p=pol&amp;set\">\n";
echo "<select name=\"pol\">\n";
if ($user['pol']==1)$sel=' selected="selected"';else $sel=NULL;
echo "<option value=\"1\"$sel>Мужской</option>\n";
if ($user['pol']==0)$sel=' selected="selected"';else $sel=NULL;
echo "<option value=\"0\"$sel>Женский</option>\n";
echo "<input value=\"Изменить\" class=\"form\" type=\"submit\" />\n";
echo "</select><br />\n";
echo "</form>\n";


?>
