I hope this is what you meant. I did delete some lines that I thought you didn't need.
<?php require_once("../WA_SecurityAssist/WA_SHA1Encryption.php"); ?>
<?php require_once('../connections/dbc.php');?>
<?php require_once( "../WA_SecurityAssist/Helper_PHP.php" ); ?>
<?php
if(isset($_POST["LogIn"])){
$WA_Auth_Parameter = array(
"connection" => $dbc,
"database" => $database_dbc,
"tableName" => "tbl_users",
"columns" => explode($WA_Auth_Separator,"username".$WA_Auth_Separator."password"),
"columnValues" => explode($WA_Auth_Separator,"".((isset($_POST["username"]))?$_POST["username"]:"") ."".$WA_Auth_Separator."".WA_SHA1Encryption(((isset($_POST["password"]))?$_POST["password"]:"")) .""),
"columnTypes" => explode($WA_Auth_Separator,"text".$WA_Auth_Separator."text"),
"sessionColumns" => explode($WA_Auth_Separator,"userID".$WA_Auth_Separator."rcode"),
"sessionNames" => explode($WA_Auth_Separator,"userID".$WA_Auth_Separator."rcode"),
"successRedirect" => "../redirect.php",
"failRedirect" => "mess_loginFailed.php",
"gotoPreviousURL" => FALSE,
"keepQueryString" => TRUE
);
WA_AuthenticateUser($WA_Auth_Parameter);
}
?>
<?php
// *** Validate request to login to this site.
if (!isset($_SESSION)) {
session_start();
}
$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($_GET['accesscheck'])) {
$_SESSION['PrevUrl'] = $_GET['accesscheck'];
}
if (isset($_POST['username'])) {
$loginUsername=$_POST['username'];
$password=$_POST['password'];
$MM_fldUserAuthorization = "";
$MM_redirectLoginSuccess = "../redirect.php";
$MM_redirectLoginFailed = "mess_loginFailed.php";
$MM_redirecttoReferrer = true;
mysql_select_db($database_dbc, $dbc);
$LoginRS__query=sprintf("SELECT userID, password FROM tbl_users WHERE userID=%s AND password=%s",
GetSQLValueString($loginUsername, "int"), GetSQLValueString($password, "text"));
$LoginRS = mysql_query($LoginRS__query, $dbc) or die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);
if ($loginFoundUser) {
$loginStrGroup = "";
//declare two session variables and assign them
$_SESSION['MM_Username'] = $loginUsername;
$_SESSION['MM_UserGroup'] = $loginStrGroup;
if (isset($_SESSION['PrevUrl']) && true) {
$MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
}
header("Location: " . $MM_redirectLoginSuccess );
}
else {
header("Location: ". $MM_redirectLoginFailed );
}
}
// start session varible
if (!isset($_SESSION)) {
session_start();
}
mysql_select_db($database_dbc, $dbc);
?>
<?php
if ((((isset($_POST["rem"]))?$_POST["rem"]:"") != "")) {
setcookie("rem", "".((isset($_POST["rem"]))?$_POST["rem"]:"") ."", time()+(60*60*24*90), "/", "", 0);
}
?>
<?php
if ((((isset($_POST["rem"]))?$_POST["rem"]:"") != "")) {
setcookie("password", "".((isset($_POST["password"]))?$_POST["password"]:"") ."", time()+(60*60*24*90), "/", "", 0);
}
?>
<?php
if ((((isset($_POST["rem"]))?$_POST["rem"]:"") != "")) {
setcookie("username", "".((isset($_POST["username"]))?$_POST["username"]:"") ."", time()+(60*60*24*90), "/", "", 0);
}?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
</head>
<body onload="document.WAATKLogInForm.username.focus()">
<div id="container">
<div id="header">
<h2 align="center"><strong>Member Login</strong></h2>
</div>
<form ACTION="<?php echo $loginFormAction; ?>" method="POST" name="WAATKLogInForm" id="WAATKLogInForm">
<table width="55%" border="0" align="center" cellpadding="5" cellspacing="0" class="WAATKDataTable">
<tr>
<th width="28%" height="39"><span class="style4">Username</span></th>
<td width="72%"><input name="username" type="text" value="<?php echo((isset($_COOKIE["username"]))?$_COOKIE["username"]:"") ?>" size="40" maxlength="40" /></td>
</tr>
<tr>
<th height="43"><span class="style4">Password</span></th>
<td><input name="password" type="password" value="<?php echo((isset($_COOKIE["password"]))?$_COOKIE["password"]:"") ?>" size="40" maxlength="40" id="password" /></td>
</tr>
<tr>
<th height="43"> </th>
<td><label>
<input name="rem" type="checkbox" id="rem" <?php if (!(strcmp(((isset($_COOKIE["rem"]))?$_COOKIE["rem"]:""),1))) {echo "checked=\"checked\"";} ?> />
<span class="style6">Remeber Me</span></label></td>
</tr>
<tr>
<th height="43"> </th>
<td><a href="forgot_password.php"><span class="style4"><strong>Forgot Password</strong></span></a></td>
</tr>
</table>
<p> </p>
<div align="center">
<input type="Submit" name="LogIn" id="LogIn" value="Log In">
</div>
</form>
<p> </p>
<table width="25%" border="1" align="center" cellpadding="5">
<tr>
<td><label> </label>
<div align="center">
<input name="redirect" type="button" id="redirect" onClick="MM_goToURL('plugins/parent','../redirect.php');return document.MM_returnValue" value="Homepage">
</div></td>
</tr>
</table>
</div>
</body>
</html>