Location: PHPKode > projects > vasp (Virtual Agenda System Project) > vasp 0.01/htdocs/index.php
<?php
session_save_path('/home/groups/v/va/vasp/sessions');
session_start(); 
header("Cache-control: private"); // IE 6 Fix. 
?>
<HTML>
<HEAD>
<TITLE>vasp Homepage</TITLE>
<link href="vaspstyle.css" rel="stylesheet" type="text/css">
</HEAD>
<BODY leftmargin="0" topmargin="0" rightmargin="0" bottommargin"0">
<div ID="fullpage" align="center">
<a href="http://sourceforge.net"><img src="http://sourceforge.net/sflogo.php?group_id=123193&amp;type=1" width="88" height="31" border="0" alt="SourceForge.net Logo" align="left"/></a>
<div ID="loginbox">
	<span align="center">vasp Login Page</span>
	<p>
<?php
	$pass = $_POST['pass'];
	$username = $_POST['user'];
	include 'config.php';
	$dbcon = mysql_connect("$mysqlserver","$mysqluser","$mysqlpass");
	if (!$dbcon) {
		echo ('Unable to connect to MySQL server');
		exit();
	}
	mysql_select_db("$mysqldb");
	
	if (empty($pass)) {
		echo "<form action=\"index.php\" method=\"post\">
			Enter Username: <input type=\"text\" name=\"user\"><br>
			Enter Password: <input type=\"password\" name=\"pass\">
			<input type=\"submit\" name=\"submit\" value=\"Login\">
			</form>";
	}
	else {
	$pass = md5($pass);
	$findhash = mysql_query("SELECT `MD5` FROM `user` WHERE user = \"$username\"");
	$userrow = mysql_fetch_array($findhash);
	$hash = $userrow['MD5'];
	$findhash = mysql_query("SELECT `ID` FROM `user` WHERE user = \"$username\"");
	$userrow = mysql_fetch_array($findhash);
	$ID = $userrow['ID'];
	$findhash = mysql_query("SELECT `enable` FROM `user` WHERE user = \"$username\"");
	$userrow = mysql_fetch_array($findhash);
	$enable = $userrow['enable'];
	if ($hash == $pass) {
		if ($enable == 0) {
			echo 'Your account has not been verified by a Admin user, please contact your Admin';}
					else {	
			echo 'Password accepted, Click <a href="index2.php">here</a> to continue.';
			$_SESSION['userid'] = $ID;}
	}
	else {echo 'User or password incorrect';
	}}
?>		
</div>
</div>
</BODY>
</HTML>







Return current item: vasp (Virtual Agenda System Project)