Help with Verify Form field Information
Hello Suport,
I really do appreciate your help. Below is the script that I generated for the verify.php page. I tried testing the page by entering the match information in the database and was not redirected to the userEmailPW page. I was expecting to be redirected as soon as the information that I entered match that of the database. I was also expecting that if the information do not match that in the database, it should not be redirected until the correct information is entered.
Also, concerning the Extra check for the userEmailPW page access, you said
"If you would like it so the user cannot get to the email password page by just going there directly then you would need to make an extra check, you can set a session variable on the verify page after you check for the recordset being empty and before you send the user to the email password page. You would then have a check at the top of the email password page for the user_verified session variable you created. If the variable is not set or does not have a value then you would redirect them back to the verify page."
How do I create the extra check? any step by step clue?
I know I am probably doing something wrong or I must have left out or included some scripts which may or may not be required for the page to work.
Please, I will appreciate if you can give me some directives on how to get this work.
Thanks in advance
<?php require_once('../Connections/spartancare.php'); ?>
<?php require_once( "../WA_SecurityAssist/Helper_PHP.php" ); ?>
<?php
if($_SERVER["REQUEST_METHOD"] == "POST"){
$WA_Auth_Parameter = array(
"connection" => $spartancare,
"database" => $database_spartancare,
"tableName" => "user",
"columns" => explode($WA_Auth_Separator,"FirstName".$WA_Auth_Separator."LastName".$WA_Auth_Separator."Phone".$WA_Auth_Separator."Zipcode"),
"columnValues" => explode($WA_Auth_Separator,"".$_SESSION['FirstName'] ."".$WA_Auth_Separator."".$_SESSION['LastName'] ."".$WA_Auth_Separator."".$_SESSION['Phone'] ."".$WA_Auth_Separator."".$_SESSION['Zipcode'] .""),
"columnTypes" => explode($WA_Auth_Separator,"text".$WA_Auth_Separator."text".$WA_Auth_Separator."text".$WA_Auth_Separator."text"),
"sessionColumns" => explode($WA_Auth_Separator,"FirstName".$WA_Auth_Separator."LastName".$WA_Auth_Separator."Phone".$WA_Auth_Separator."Zipcode"),
"sessionNames" => explode($WA_Auth_Separator,"FirstName".$WA_Auth_Separator."LastName".$WA_Auth_Separator."Phone".$WA_Auth_Separator."Zipcode"),
"successRedirect" => "userEmailPW.php",
"failRedirect" => "verify.php",
"gotoPreviousURL" => FALSE,
"keepQueryString" => TRUE
);
WA_AuthenticateUser($WA_Auth_Parameter);
}
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$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;
}
}
$colname_verifyrs = "-1";
if (isset($_SESSION['UserName'])) {
$colname_verifyrs = (get_magic_quotes_gpc()) ? $_SESSION['UserName'] : addslashes($_SESSION['UserName']);
}
mysql_select_db($database_spartancare, $spartancare);
$query_verifyrs = sprintf("SELECT FirstName, LastName, Phone, Zipcode FROM `user` WHERE UserName = %s", GetSQLValueString($colname_verifyrs, "text"));
$verifyrs = mysql_query($query_verifyrs, $spartancare) or die(mysql_error());
$row_verifyrs = mysql_fetch_assoc($verifyrs);
$totalRows_verifyrs = mysql_num_rows($verifyrs);
?>
Below is the action script on the form as you suggested.
<form action="<?php echo((isset($_SERVER["PHP_SELF"]))?$_SERVER["PHP_SELF"]:"") ?>" method="post">