I see I can show you it just for your information:
I had such a simply login file:
<form method="POST" action="<?echo $PHP_SELF;?>?pd=otworz">
<?if (!($POST['login']=="michal"&&$POST['haslo']=="kichal")){?>
<table border="0" height="24" width="281" cellspacing="1" cellpadding="0" align="center">
<tr>
<td height="25" valign="middle" align="right" width="275" colspan="2" style="text-align: Justify; word-spacing: 0; line-height: 100%; text-indent: 0; border-bottom-style: solid; border-bottom-width: 1; margin: 0">
<p align="center">strefa dla pracowników:</p>
</td>
</tr>
<tr>
<td height="25" valign="middle" align="right" width="94">
<p style="word-spacing: 0; margin-bottom: 0">login:
</td>
<td height="25" valign="top" width="177">
<input type="text" name="login" size="20" style="border-style: solid; border-width: 1" >
</td>
</tr>
<tr>
<td height="25" valign="middle" align="right" width="94">
<p style="word-spacing: 0; margin-bottom: 0">has³o:
</td>
<td height="25" valign="top" width="177">
<input type="password" name="haslo" size="20" style="border-style: solid; border-width: 1" >
</td>
</tr>
<tr>
<td height="27" valign="middle" align="center" width="95">
<p> </p>
</td>
<td height="27" valign="middle" width="123" align="left" >
<input style="BORDER-RIGHT: 1px solid; BORDER-TOP: 1px solid; FONT-SIZE: 8pt; BORDER-LEFT: 1px solid; BORDER-BOTTOM: 1px solid; FONT-FAMILY: Verdana" type="submit" value="zaloguj siê" name="zaloguj" class="buttonColor" >
</td>
</tr>
</table>
</form>
<?;}else {?>
<TABLE cellSpacing=0 cellPadding=0 width=600 bgColor=#989898 border=0 align=center >
<TD height="39" width="600">
<TABLE cellSpacing=0 cellPadding=0 width=600 bgColor=#ffffff border=0 align=center >
<TBODY> <TD height=10 width="600"></TD>
<TR>
<TD align=middle>
<TABLE cellSpacing=0 cellPadding=0 width="100%" align=center
border=0>
<TBODY>
<TR>
<TD height="100" width="600" align="center" >
<? include("dla_pracownikow/test.php");?>
</TD>
</TR>
</TBODY>
</TABLE>
</TD></TR></TBODY>
<TD height=11 width="600"></TD>
</TABLE>
</TD>
</TABLE>
<?;}?>
I changed order of two first lines:
<?if (!($POST['login']=="michal"&&$POST['haslo']=="kichal")){?>
<form method="POST" action="<?echo $PHP_SELF;?>?pd=otworz">
and it works fine
form file is dla_pracownikow/test.php