<?php
error_reporting(0);
session_start();
header("Content-type: text/HTML; charset=utf-8"); 
if($_POST["username"]!="" && $_POST["password"]!="")
{
	//you can change username and password here.
	if(strtolower($_POST["username"])=="test" && $_POST["password"]=="1234")
	{
		$_SESSION["g_username"] = $_POST["username"];
		$_SESSION["g_commport"] = $_POST["commport"];
		echo "<script language='javascript' type='text/javascript'>window.location.href='main.php';</script>";
		//echo "<script language='javascript' type='text/javascript'>window.location.href='srvmgr.php';</script>";
	}
	else
	{
		echo '<script type="text/javascript">alert("Login unsuccessfully!");</script>';
	}
}
?>
<script type="text/javascript">
function fill_test_account()
{
	document.frmLogin.commport.value = "9999";
	//you can enable auto-login here.
	document.frmLogin.username.value = "test";
	document.frmLogin.password.value = "1234";
	document.frmLogin.btnLogin.click();
}
</script>
<html>
<head>
<title>Windows Batch Deployment Web Control Panel - Login</title>
</head>
<body onload="fill_test_account()">
<form method = "post" action="index.php" name="frmLogin">
<h2>Username: </h2><input type="text" style="width:100%;height:100px;font-size:75px" name="username" size="20" value=""></input>
<h2>Password: </h2><input type="password" style="width:100%;height:100px;font-size:75px" name="password" size="20" value=""></input>
<h2>Server Program Port: </h2><input type="text" style="width:100%;height:100px;font-size:75px" name="commport" size="20" value="9999"></input>
<hr></hr><input type="submit" style="width:100%;height:100px;font-size:75px" name="btnLogin" value="Login"></input>
</form>
</body>
</html>