close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Remember me check box not working

Thread began 9/09/2012 10:19 pm by chssagmi366905 | Last modified 9/10/2012 11:14 am by chssagmi366905 | 1751 views | 1 replies

chssagmi366905

checkbox update

<?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);
}?>
<?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);
}

if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
?>
<?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" "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=utf-8" />
<title>Log In</title>
<link href="../styles.css" rel="stylesheet" type="text/css" />
<style type="text/css" media="screen">
<!--
@import url("../p7tbm/p7tbm_navy_06.css");
-->
</style>
<script type="text/javascript" src="../p7tbm/p7tbmenu.js"></script>
<link href="../WA_SecurityAssist/styles/Modular_Pacifica.css" rel="stylesheet" type="text/css" />
<link href="../WA_SecurityAssist/styles/Verdana.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
<!--
function MM_goToURL() { //v3.0
var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
//-->
</script>
<style type="text/css">
<!--
.style4 {font-size: 14px}
.style6 {font-size: 14px; font-weight: bold; }
-->
</style>
</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">&nbsp;</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">&nbsp;</th>
<td><a href="forgot_password.php"><span class="style4"><strong>Forgot Password</strong></span></a></td>
</tr>
</table>
<p>&nbsp;</p>
<div align="center">
<input type="Submit" name="LogIn" id="LogIn" value="Log In">
</div>

</form>
<p>&nbsp;</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>
<p>&nbsp;</p>
<?php

//--include footer--
include ('../includes/footer.inc.html');

?>
</div>
</body>
</html>

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...