Location: PHPKode > projects > ZompLog > login.php
<?php

/* Written by Gerben Schmidt, http://scripts.zomp.nl */
ob_start();
include_once("admin/functions.php");
include_once("admin/config.php");
include("admin/session.php");
include('admin/loadsettings.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Zomplog &rsaquo; Login</title>

<script type="text/javascript">
	function focusit() {
		document.getElementById('log').focus();
	}
	window.onload = focusit;
	</script>
	<style type="text/css">
	#log, #pwd, #submit {
		font-size: 2.3em;
	}
	</style>
	
<link href="admin/images/docsstyle.css" rel="stylesheet" type="text/css" />

</head>
<body>

<a name="top"></a>

<div id="header">
<div class="headercontent">
</div>
</div>
<div id="mainbox">
<div class="maincontent">

<?php


checkLoggedIn("no");


if($_POST["submit"]) {
	
	field_validator("login name", $_POST["login"], "alphanumeric", 4, 15);
	
	field_validator("password", $_POST["password"], "string", 4, 15);


	if($messages){ 
		doIndex();
		
		exit;
	}

	$password = md5($_POST['password']);

    if( !($row = checkPass($_POST["login"], $password)) ) {
		
        $messages[]="Incorrect login/password, try again";
    } 

	
	if($messages){
		doIndex();
		exit;
	}

	
	cleanMemberSession($row[login], $row[password]);

	header("Location: admin/members.php?".session_name()."=".session_id());
	
	ob_end_flush();
	
} else {	
	
	doIndex();
}


function doIndex() {
	
	global $messages;



if($messages) { displayErrors($messages); }

?>
<br />

<form action="<?php echo $_SERVER["admin/PHP_SELF"]?>" method="POST">
  <table width="100" align="center" border="0">
    <tr>
      <td><table align="center" class="text">

        <tr>
          <td colspan="2"><div class="title">Log in</div></td>
        </tr>
        <tr>
          <td colspan="2">&nbsp;</td>
        </tr>
        <tr>
          <td colspan="2"><span class="style2">Username:</span></td>
        </tr>
        <tr>
          <td colspan="2"><input type="text" name="login" value="<?php print $_POST["login"] ?>" maxlength="15" id="log" /></td>
        </tr>
        <tr>
          <td colspan="2"><span class="style2">Password:</span></td>
        </tr>
        <tr>
          <td colspan="2"><input type="password" name="password" value="" maxlength="15" id="pwd" /></td>
        </tr>
        <tr>
          <td colspan="2"><div align="right">
              <input name="submit" type="submit" value="Login &rsaquo;&rsaquo;" id="submit" />
          </div></td>
        </tr>
        <tr>
          <td colspan="2">&nbsp;</td>
        </tr>
        <tr>
          <td width="271"><div class='style2'><a href="index.php">&lsaquo;&lsaquo; back to site </a></div></td>
          <td width="135"><div align="right"><span class="style1"><a href="http://www.zomp.nl/zomplog/" target="_blank">zomplog &rsaquo;&rsaquo;</a> </span></div></td>
        </tr>
      </table></td>
    </tr>
  </table>
</form>

<br />
<?php 
}
?>

</div>
</div>
</body>
</html>
Return current item: ZompLog