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

if (isset($_GET['set']))
{
if (isset($_POST['set_show_mail']) && $_POST['set_show_mail']==1)
{
$user['set_show_mail']=1;
mysql_query("UPDATE `user` SET `set_show_mail` = '1' WHERE `id` = '$user[id]' LIMIT 1");
}
else
{
$user['set_show_mail']=0;
mysql_query("UPDATE `user` SET `set_show_mail` = '0' WHERE `id` = '$user[id]' LIMIT 1");
}
if (isset($_POST['ank_mail']) && (eregi('^[^@]*@[^@]*\.[^@]*$',$_POST['ank_mail']) || $_POST['ank_mail']==NULL))
{
$user['ank_mail']=esc($_POST['ank_mail']);
mysql_query("UPDATE `user` SET `ank_mail` = '$user[ank_mail]' WHERE `id` = '$user[id]' LIMIT 1");
}
else $err='Неверный E-mail';
header ("Location: anketa.php?ok&".SID."");
exit;}
err();
aut();

echo "<form method=\"post\" action=\"anketa.php?p=mail&amp;set\">\n";
echo "E-mail:<br />\n<input type='text' name='ank_mail' value='$user[ank_mail]' maxlength='32' /><br/>\n";
if ($user['set_show_mail']==1)$check=' checked="checked"';else $check=NULL;
echo "<label><input type=\"checkbox\" name=\"set_show_mail\"$check value=\"1\" /> Показывать E-mail в анкете</label><br />\n";
echo "<input value=\"Изменить\" class=\"form\" type=\"submit\" />\n";
echo "</form>\n";


?>
