Location: PHPKode > projects > Guestbook! > guestbook/adm/index.php
<?php
  include( "../inc/nocache.inc" );
// ïîäêëþ÷àåì ôàéë ñ àäìèí. èìåíåì è ïàðîëåì
  include( "./config.php" );

  $mode=((!isset($_GET["mode"]))?"":$_GET["mode"]);
  $LOGIN=((!isset($_POST["LOGIN"]))?"":$_POST["LOGIN"]);
  $PASSWORD=((!isset($_POST["PASSWORD"]))?"":$_POST["PASSWORD"]);

  if ($mode == "login") {
	if (authUser($LOGIN, $PASSWORD)) {
			setcookie("gb_login", $LOGIN);
			setcookie("gb_password", $PASSWORD);
			header("Location: main.php");
			exit();
		} 
		else {
			echo("Íåïðàâèëüíûé ëîãèí èëè ïàðîëü.");
			exit();
		}		
	} else {	
?>
<html>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<body text="#ffffff" marginwidth=0 marginheight=0 leftmargin=0 topmargin=0>

<center>
<table width="100%" height="100%" align=center valign=middle>
<tr><td valign=middle align=center>
<form action="index.php?mode=login" method=post>
<table border=0 cellspacing=0 cellpadding=0 width="170">
<tr bgcolor="#666666">
<td rowspan="7" width=4>&nbsp;</td>
<td height="18" valign="bottom">&nbsp;&nbsp;<font face="Verdana" size=2>Ëîãèí</font></td>
<td rowspan="7" width=4>&nbsp;</td>
</tr>
<tr bgcolor="#666666"><td><input type="text" name="LOGIN" size="13" style="width:160px;"></td></tr>
<tr bgcolor="#666666"><td height="18" valign="bottom">&nbsp;&nbsp;<font face="Verdana" size=2>Ïàðîëü</font></td></tr>
<tr bgcolor="#666666"><td>
<input type="password" name="PASSWORD" size="13" style="width:160px;">
</td></tr>
<tr bgcolor="#666666"><td height=10>&nbsp;</td></tr>
<tr bgcolor="#666666"><td height="18" align="right">
<input type="submit" value=":: Âõîä ::"></td></tr>
<tr bgcolor="#666666"><td height=7>&nbsp;</td></tr>
</table>
</form>
</td>
</tr>
</table>
</center>
</body>
</html>
<?php
  }
?>
Return current item: Guestbook!