
PK 
<?php
session_start();
$errorMessage = '';
if (isset($_POST['username']) && isset($_POST['password'])) {
include("index_connexion.php");
$tname = $_POST['username'];
$Password1 =md5($_POST['password']);
// check if the user id and password combination exist in database
$sql = "SELECT user
FROM amembs
WHERE user = '$tname'
AND pass =('$Password1')";
$result = mysql_query($sql)
or die('Query failed. ' . mysql_error());
if (mysql_num_rows($result) == 1) {
// the user id and password match,
// set the session
$_SESSION['super'] = true;
$_SESSION['city'] = $_POST['city'];
$din=date('D, d M Y + H:i:s a');
$sql = "UPDATE amembs
SET lastlogin='$din'
WHERE user = '$tname'
AND pass =('$Password1')";
$result = mysql_query($sql)
or die('Query failed. ' . mysql_error());
// after login we move to the main page
//header('Location: admin.php');
// exit;
} else {
$errorMessage = 'Sorry, wrong user id / password';
}
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Edusoft Installation Startup - Validate Licience Key</title>
<link rel="stylesheet" type="text/css" href="template.css" media="screen" />
<link rel="stylesheet" type="text/css" href="template2.css" media="screen" />
<link rel="stylesheet" type="text/css" href="content.css" media="screen" />
<link rel="stylesheet" type="text/css" href="portal-page.css" media="screen" title="Dalvay"/>
<script language="JavaScript" type="text/javascript">
<!--
function checkform ( form )
{
// ** START **
if (form.user.value == "") {
alert( "Please enter user name." );
form.user.focus();
return false ;
}
// ** END **
// ** START **
if (form.pass.value == "") {
alert( "Please enter password:" );
form.pass.focus();
return false ;
}
// ** END **
return true ;
}
//-->
</script>
</head>
<body id="central" class="portal-page">
<div class="portal-box">
<div class="portal-box-interior">
<div class="portal-box-header">
<h1>
Members Login...
</h1>
</div>
<img src="bulk_mid" align="right" height="190">
<div class="portal-box-contents">
<div class="corner-box">
<form action="" method="post" onSubmit="return checkform(this);">
<strong>Username >> </strong></font>
<input type="text" name="username" size="25" maxlength="30">
<br><br>
<strong>Password >> </strong></font>
<input type="password" name="password" size="25" maxlength="30">
<br><br>
<strong>Branch >> </strong></font>
<select name="city">
<option value="amritser">Amritser</option>
<option value="ludhiana">Ludhiana</option>
</select>
<br><br>
</div>
<center> <span class="portal-button"><input type="submit" class="amo-submit" value=" Login into Members Area >>"></form></span> </center>
</div> <!-- end .portal-box-contents -->
</div> <!-- end .portal-box-interior -->
</div> <!-- end .portal-box -->
<hr />
<!-- start #footer -->
<div id="footer">
<p dir="ltr">copyrights © 2005–2007 Anibs Management Solutions</p>
</div>
<!-- end #footer -->
</body>
</html>


PK 99