Insert from login page
It still doesn't insert into the table.
<?php require_once('Connections/first.php');?>
<?php require_once("WA_DataAssist/WA_AppBuilder_PHP.php"); ?>
<?php require_once("WA_SecurityAssist/WA_SHA1Encryption.php"); ?>
<?php require_once( "WA_SecurityAssist/Helper_PHP.php" ); ?>
<?php
if ((((isset($_POST["remembermeoption"]))?$_POST["remembermeoption"]:"") != "")) {
setcookie("RememberMePWD", "".((isset($_POST["userpassword"]))?$_POST["userpassword"]:"") ."", time()+(60*60*24*30), "/", "", 0);
}
?>
<?php
if ((((isset($_POST["remembermeoption"]))?$_POST["remembermeoption"]:"") != "")) {
setcookie("RememberMeUN", "".((isset($_POST["username"]))?$_POST["username"]:"") ."", time()+(60*60*24*30), "/", "", 0);
}
?>
<?php
if (isset($_POST["LogIn_x"]) && !isset($_POST["remembermeoption"])) {
setcookie("RememberMePWD", "", time()+(60*60*24*30), "/", "", 0);
}
?>
<?php
if (isset($_POST["LogIn_x"]) && !isset($_POST["remembermeoption"])) {
setcookie("RememberMeUN", "", time()+(60*60*24*30), "/", "", 0);
}
?>
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $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 != "") ? "'" . date("Y-m-d",strtotime($theValue)) . "'" : "NULL";
break;
case "time":
$theValue = ($theValue != "") ? "'" . date("H:i:s",strtotime($theValue)) . "'" : "NULL";
break;
case "datetime":
$theValue = ($theValue != "") ? "'" . date("Y-m-d H:i:s",strtotime($theValue)) . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
?>
<?php
if(isset($_POST["LogIn_x"])){
$WA_Auth_Parameter = array(
"connection" => $first,
"database" => $database_first,
"tableName" => "users",
"columns" => explode($WA_Auth_Separator,"userCSRID".$WA_Auth_Separator."userpassword"),
"columnValues" => explode($WA_Auth_Separator,"".((isset($_POST["username"]))?$_POST["username"]:"") ."".$WA_Auth_Separator."".WA_SHA1Encryption(((isset($_POST["userpassword"]))?$_POST["userpassword"]:"")) .""),
"columnTypes" => explode($WA_Auth_Separator,"text".$WA_Auth_Separator."text"),
"sessionColumns" => explode($WA_Auth_Separator,"userID".$WA_Auth_Separator."userLevel".$WA_Auth_Separator."userCSRID".$WA_Auth_Separator."userActive".$WA_Auth_Separator."firstLogIn"),
"sessionNames" => explode($WA_Auth_Separator,"userID".$WA_Auth_Separator."userLevel".$WA_Auth_Separator."userCSRID".$WA_Auth_Separator."userActive".$WA_Auth_Separator."firstLogIn"),
"successRedirect" => "users_Profile.php",
"failRedirect" => "users_LogIn.php?failed=1",
"gotoPreviousURL" => TRUE,
"keepQueryString" => TRUE
);
WA_AuthenticateUser($WA_Auth_Parameter);
}?>
<?php
// WA Application Builder Insert
if (isset($_POST["LogIn_x"])) // Trigger
{
$WA_connection = $first;
$WA_table = "user_LogTime";
$WA_sessionName = "user_LogTime_logID";
$WA_redirectURL = "";
$WA_keepQueryString = false;
$WA_indexField = "logID";
$WA_fieldNamesStr = "logUserID";
$WA_fieldValuesStr = "".((isset($_POST["logUserID"]))?$_POST["logUserID"]:"") ."";
$WA_columnTypesStr = "',none,''";
$WA_fieldNames = explode("|", $WA_fieldNamesStr);
$WA_fieldValues = explode("|", $WA_fieldValuesStr);
$WA_columns = explode("|", $WA_columnTypesStr);
$WA_connectionDB = $database_first;
mysql_select_db($WA_connectionDB, $WA_connection);
if (!session_id()) session_start();
$insertParamsObj = WA_AB_generateInsertParams($WA_fieldNames, $WA_columns, $WA_fieldValues, -1);
$WA_Sql = "INSERT INTO `" . $WA_table . "` (" . $insertParamsObj->WA_tableValues . ") VALUES (" . $insertParamsObj->WA_dbValues . ")";
$MM_editCmd = mysql_query($WA_Sql, $WA_connection) or die(mysql_error());
$_SESSION[$WA_sessionName] = mysql_insert_id();
if ($WA_redirectURL != "") {
if ($WA_keepQueryString && $WA_redirectURL != "" && isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] !== "" && sizeof($_POST) > 0) {
$WA_redirectURL .= ((strpos($WA_redirectURL, '?') === false)?"?":"&").$_SERVER["QUERY_STRING"];
}
header("Location: ".$WA_redirectURL);
}
}
?>
<div id="LogInContainer" class="WAATK">
<form method="POST" name="WAATKLogInForm" id="WAATKLogInForm">
<h1>Please Log In</h1>
<table class="WAATKDataTable" cellpadding="0" cellspacing="0" border="0">
<?php if(WA_Auth_RulePasses("Login Failed")){ // Begin Show Region ?>
<tr>
<th> </th>
<td><span class="textfieldServerError" >The login information provided is not valid. Please try again.</span></td>
</tr>
<?php } // End Show Region ?>
<tr>
<th>Enter your CSRID</th>
<td><span id="sprytextfield1">
<input type="text" class="WAATKTextField" name="username" value="<?php echo((isset($_COOKIE["RememberMeUN"]) && isset($_COOKIE["RememberMePWD"]))?$_COOKIE["RememberMeUN"]:"") ?>" />
<span class="textfieldRequiredMsg">A value is required.</span></span></td>
</tr>
<tr>
<th>Password</th>
<td><span id="sprypassword1">
<input type="password" class="WAATKTextField" name="userpassword" value="<?php echo((isset($_COOKIE["RememberMePWD"]))?$_COOKIE["RememberMePWD"]:"") ?>" />
<span class="passwordRequiredMsg">A value is required.</span></span></td>
</tr>
<tr>
<th class="WAATKDataTableHeader"><input type="checkbox" name="remembermeoption" <?php echo((isset($_COOKIE["RememberMeUN"]))?"checked":"") ?> value="1" /></th>
<td class="WAATKDataTableCell">Remember me</td>
</tr>
<tr>
<th class="WAATKDataTableHeader"> </th>
<td class="WAATKDataTableCell"><span class="WAATKDataTableHeader">(<a href="users_EmailPW.php">forgot</a> your password?)</span></td>
</tr>
</table>
<div class="WAATKButtonRow">
<input type="image" hspace="0" vspace="0" border="0" name="LogIn" id="LogIn" value="Log In" alt="Log In" src="WA_DataAssist/images/Slate/Refined_insert.gif" />
<input name="logUserID" type="hidden" id="logUserID" value="<?php echo $_SESSION['userCSRID']; ?>" />
</div>
</form>
</div>
<script type="text/javascript">
<!--
var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "none", {validateOn:["blur"]});
var sprypassword1 = new Spry.Widget.ValidationPassword("sprypassword1", {validateOn:["blur"]});
//-->
</script>