Autor Zpráva
kOsTEj
Profil
Cest chlapi, uz nevim co,tak pisu sem, tenhle zdrojak obsahuje form, kterej vola sam sebe,ale kdyz se zavola,tak se neprenesou udaje $nick,$name, jediny co se prenese je $email... nerozumim tomu... dik za rady

-jinak head() a foot() obsahujou jenom zacatek a konec hmtl stranky...
- buttonek() akorat zavira celou stranku

<?
include "../function.php";
include "../conn.php";

$error = ''; // promìnná obsahuje pøípadné chybové hlášení

// editace uživatele
if ($email != "" && $pass != "" && $nick != "" && $name != "")
{
if (!isset($deny)) $deny = 1;

@$sql = mysql_query("SELECT * FROM users WHERE nick LIKE '$nick'");
if (mysql_num_rows($sql) > 0)
{
$login = '';
$error = "<DIV ALIGN=CENTER>Login již existuje !!!</DIV>\n";
}
else
{
// pøidáme uživatele
@$sql = mysql_query("INSERT INTO users VALUES (null,'$nick','$name', '".md5($heslo)."','$email',
'$deny','$poz')") or die(mysql_error());

mysql_close($conn);
zavri();
exit;
}
}

// databázi již nebudeme potøebovat
mysql_close($conn);

head()
?>

<H4 ALIGN="CENTER"><B>Editace uživatele</B></H4>

<? echo $error; ?>

<FORM METHOD="POST" ACTION="add_user.php">
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" ALIGN="CENTER">
<TR>
<TD>Login: *&nbsp;</TD>
<TD><INPUT TYPE="TEXT" NAME="nick" MAXLENGTH="20" SIZE="40" VALUE="<? echo $nick; ?>"></TD>
</TR>
<TR>
<TD>Heslo: *&nbsp;</TD>
<TD><INPUT TYPE="TEXT" NAME="pass" MAXLENGTH="25" SIZE="40" VALUE=""></TD>
</TR>
<TR>
<TD>Email: *&nbsp;</TD>
<TD><INPUT TYPE="TEXT" NAME="email" MAXLENGTH="100" SIZE="40" VALUE="<? echo $email; ?>"></TD>
</TR>
<TR>
<TD>Jméno: *&nbsp;</TD>
<TD><INPUT TYPE="TEXT" NAME="name" MAXLENGTH="100" SIZE="40" VALUE="<? echo $name; ?>"></TD>
</TR>
<TR>
<TD>Pozice: &nbsp;</TD>
<TD><SELECT name="poz">
<?

for ($i = 1; $i <= 2; $i++)
{
echo "<OPTION VALUE=\"$i\"";
if ($i == $poz)
echo " SELECTED";
echo ">$pozice[$i]</OPTION>";
}
?>
</SELECT></TD>
</TR>
<TR>
<TD>Aktivní: &nbsp;</TD>
<TD><INPUT TYPE="CHECKBOX" NAME="deny" VALUE="0"<? if ($deny == 0) echo " CHECKED"; ?>></TD>
</TR>
<TR>
<TD COLSPAN="2" ALIGN="CENTER">
<INPUT TYPE="SUBMIT" VALUE="Pøidat">
<? butonek(); ?>
</TD>
</TR>
</TABLE>
</FORM>

<?
foot();
?>
kOsTEj
Profil
uz sem na to prisel, dela bordel ten checkbox....
Toto téma je uzamčeno. Odpověď nelze zaslat.