close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Help with Verify Form field Information

Thread began 12/11/2009 7:40 am by buonsen368464 | Last modified 1/04/2010 12:56 pm by buonsen368464 | 5139 views | 21 replies

buonsen368464

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">

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...