close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Pre-Populating Field when Validation Fails

Thread began 5/09/2015 9:18 pm by Armen | Last modified 5/11/2015 5:30 pm by Ray Borduin | 4056 views | 4 replies |

Armen

Pre-Populating Field when Validation Fails

I have several server-side validations on a page. However, only one (password match) returns me to the page with the form fields pre-populated on an unsuccessful validation. I need the forms pre-populated when any of the validation fail.

Page code:

<?php require_once('Connections/connData.php'); ?>
<?php require_once("webassist/form_validations/wavt_scripts_php.php"); ?>
<?php require_once("webassist/form_validations/wavt_validatedform_php.php"); ?>
<?php require_once("webassist/database_management/wa_appbuilder_php.php"); ?>
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$WAFV_Redirect = "reg_error_email.php";
$_SESSION['WAVT_register_697_Errors'] = "";
if ($WAFV_Redirect == "") {
$WAFV_Redirect = $_SERVER["PHP_SELF"];
}
$WAFV_Errors = "";
$WAFV_Errors .= WAValidateUnique("connData",$connData,$database_connData,"mycv","ID","none,none,NULL","0","email","',none,''","".(((isset($_POST["Email"]))?$_POST["Email"]:"")) ."",true,5);

if ($WAFV_Errors != "") {
PostResult($WAFV_Redirect,$WAFV_Errors,"register_697");
}
}
?>
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$WAFV_Redirect = "register.php";
$_SESSION['WAVT_register_954_Errors'] = "";
if ($WAFV_Redirect == "") {
$WAFV_Redirect = $_SERVER["PHP_SELF"];
}
$WAFV_Errors = "";
$WAFV_Errors .= WAValidateLE(((isset($_POST["password"]))?$_POST["password"]:"") . "",((isset($_POST["password2"]))?$_POST["password2"]:"") . "",true,4);

if ($WAFV_Errors != "") {
PostResult($WAFV_Redirect,$WAFV_Errors,"register_954");
}
}
?>
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$WAFV_Redirect = "register.php";
$_SESSION['WAVT_register_022_Errors'] = "";
if ($WAFV_Redirect == "") {
$WAFV_Redirect = $_SERVER["PHP_SELF"];
}
$WAFV_Errors = "";
$WAFV_Errors .= WAValidateAN(((isset($_POST["Phone_Mobile"]))?$_POST["Phone_Mobile"]:"") . "",false,false,true,false,"",true,2);
$WAFV_Errors .= WAValidateEL(((isset($_POST["Phone_Mobile"]))?$_POST["Phone_Mobile"]:"") . "",10,10,true,3);

if ($WAFV_Errors != "") {
PostResult($WAFV_Redirect,$WAFV_Errors,"register_022");
}
}
?>
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$WAFV_Redirect = "register.php";
$_SESSION['WAVT_register_846_Errors'] = "";
if ($WAFV_Redirect == "") {
$WAFV_Redirect = $_SERVER["PHP_SELF"];
}
$WAFV_Errors = "";
$WAFV_Errors .= WAValidateLE(strtolower($_SESSION['captcha_Security_Code_1']) . "",strtolower(((isset($_POST["Security_Code_1"]))?$_POST["Security_Code_1"]:"")) . "",true,1);

if ($WAFV_Errors != "") {
PostResult($WAFV_Redirect,$WAFV_Errors,"register_846");
}
}
?>
<?php
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;
}
}

mysql_select_db($database_connData, $connData);
$query_rsNetwork = "SELECT * FROM wirelessNetwork ORDER BY networkName ASC";
$rsNetwork = mysql_query($query_rsNetwork, $connData) or die(mysql_error());
$row_rsNetwork = mysql_fetch_assoc($rsNetwork);
$totalRows_rsNetwork = mysql_num_rows($rsNetwork);?>
<?php
// WA DataAssist Insert
if (($_SERVER["REQUEST_METHOD"] == "POST") && (isset($_SERVER["HTTP_REFERER"]) && strpos(urldecode($_SERVER["HTTP_REFERER"]), urldecode($_SERVER["SERVER_NAME"].$_SERVER["PHP_SELF"])) > 0) && isset($_POST)) // Trigger
{
$_SESSION['confirm_time'] = date("dmHsi");
$WA_connection = $connData;
$WA_table = "mycv";
$WA_sessionName = "sessMycvID";
$WA_redirectURL = "register_rd.php";
if (function_exists("rel2abs")) $WA_redirectURL = $WA_redirectURL?rel2abs($WA_redirectURL,dirname(__FILE__)):"";
$WA_keepQueryString = false;
$WA_fieldNamesStr = "email|password|firstName|lastName|phoneLand|phoneMobile|networkID|licNumber|licState|brokerName|brokerAddress|brokerCity|brokerState|brokerZip|brokerPhone|brokerFax|brokerURL|confirm_time";
$WA_fieldValuesStr = "".((isset($_POST["Email"]))?$_POST["Email"]:"") ."" . $WA_AB_Split . "".((isset($_POST["password"]))?$_POST["password"]:"") ."" . $WA_AB_Split . "".((isset($_POST["First_Name"]))?$_POST["First_Name"]:"") ."" . $WA_AB_Split . "".((isset($_POST["Last_Name"]))?$_POST["Last_Name"]:"") ."" . $WA_AB_Split . "".((isset($_POST["Phone_Land"]))?$_POST["Phone_Land"]:"") ."" . $WA_AB_Split . "".((isset($_POST["Phone_Mobile"]))?$_POST["Phone_Mobile"]:"") ."" . $WA_AB_Split . "".((isset($_POST["networkID"]))?$_POST["networkID"]:"") ."" . $WA_AB_Split . "".((isset($_POST["relicense"]))?$_POST["relicense"]:"") ."" . $WA_AB_Split . "".((isset($_POST["statelicense"]))?$_POST["statelicense"]:"") ."" . $WA_AB_Split . "".((isset($_POST["brokerageName"]))?$_POST["brokerageName"]:"") ."" . $WA_AB_Split . "".((isset($_POST["brokerAddress"]))?$_POST["brokerAddress"]:"") ."" . $WA_AB_Split . "".((isset($_POST["brokerCity"]))?$_POST["brokerCity"]:"") ."" . $WA_AB_Split . "".((isset($_POST["brokerState"]))?$_POST["brokerState"]:"") ."" . $WA_AB_Split . "".((isset($_POST["brokerZip"]))?$_POST["brokerZip"]:"") ."" . $WA_AB_Split . "".((isset($_POST["brokerPhone"]))?$_POST["brokerPhone"]:"") ."" . $WA_AB_Split . "".((isset($_POST["brokerFax"]))?$_POST["brokerFax"]:"") ."" . $WA_AB_Split . "".((isset($_POST["brokerSite"]))?$_POST["brokerSite"]:"") ."". $WA_AB_Split . "".$_SESSION['confirm_time'];
$WA_columnTypesStr = "',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|none,none,NULL|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|none,none,NULL|',none,''|',none,''|',none,'',''|',none,''";
$WA_fieldNames = explode("|", $WA_fieldNamesStr);
$WA_fieldValues = explode($WA_AB_Split, $WA_fieldValuesStr);
$WA_columns = explode("|", $WA_columnTypesStr);
$WA_connectionDB = $database_connData;
mysql_select_db($WA_connectionDB, $WA_connection);
@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($WA_connection);

if ($WA_redirectURL != "") {
$WA_redirectURL = str_replace("[Insert_ID]",$_SESSION[$WA_sessionName],$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);
}
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1,requiresActiveX=true">
<title>Clearview Offers | cvoffers.com</title>
<meta name="description" content="...">

<!-- /// Favicons //////// -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="https://s3-us-west-1.amazonaws.com/cvoffers/_layout/images/apple-touch-icon-144-precomposed.png">
<link rel="shortcut icon" href="https://s3-us-west-1.amazonaws.com/cvoffers/_layout/images/favicon.png">

<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Open+Sans:400,300,400italic,600,600italic,700,700italic">
<link rel="stylesheet" href="https://s3-us-west-1.amazonaws.com/cvoffers/_layout/css/fontawesome/font-awesome.min.css">
<link rel="stylesheet" href="https://s3-us-west-1.amazonaws.com/cvoffers/_layout/css/iconfontcustom/icon-font-custom.css">
<link rel="stylesheet" href="https://s3-us-west-1.amazonaws.com/cvoffers/_layout/css/base.css">
<link rel="stylesheet" href="https://s3-us-west-1.amazonaws.com/cvoffers/_layout/css/grid.css">
<link rel="stylesheet" href="https://s3-us-west-1.amazonaws.com/cvoffers/_layout/css/elements.css">
<link rel="stylesheet" href="https://s3-us-west-1.amazonaws.com/cvoffers/_layout/css/layout.css">
<link rel="stylesheet" href="https://s3-us-west-1.amazonaws.com/cvoffers/_layout/css/tooltip.css">
<script type="text/javascript">
function MM_validateForm() { //v4.0
if (document.getElementById){
var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);
if (val) { nm=val.name; if ((val=val.value)!="") {
if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
} else if (test!='R') { num = parseFloat(val);
if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
min=test.substring(8,p); max=test.substring(p+1);
if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
} if (errors) alert('The following error(s) occurred:\n'+errors);
document.MM_returnValue = (errors == '');
} }
</script>
</head>

<body>
<?php include_once("_include/analyticstracking.php") ?>
<noscript>
<div class="alert warning">
<i class="fa fa-left-sides-circle"></i> You seem to have Javascript disabled. This website needs javascript in order to function properly!
</div>
</noscript>

<!--[if lte IE 8]>
<div class="alert error">
You are using an <strong>outdated</strong> browser. Please
<a href="http://windows.microsoft.com/en-us/internet-explorer/download-ie">upgrade your browser</a>
to improve your experience.
</div>
<![endif]-->

<div id="wrap">

<!-- /// HEADER-TOP /// -->
<div id="header-top">
<div class="row">
<div class="span6" id="header-top-widget-area-1">
<div class="widget ewf_widget_contact_info">
<ul>
<li> <!--1-844-4CVOFFER<br>--></li>
</ul>
</div><!-- end .ewf_widget_contact_info -->
</div><!-- end .span6 -->
<div class="span6" id="header-top-widget-area-2">
<?php include '_include/social.php'; ?>
</div><!-- end .span6 -->
</div><!-- end .row -->
</div><!-- end #header-top -->
<!-- /// HEADER-TOP END ///////// -->

<!-- /// HEADER /// -->
<div id="header">
<div class="row">
<div class="span3">
<!-- // Logo // -->
<a href="index.php" id="logo"><img src="https://s3-us-west-1.amazonaws.com/cvoffers/_layout/images/logo.png" alt="cvoffers.com - Cloud-bases real estate offer management system" width="293" height="81" class="responsive-img"></a>
</div><!-- end .span3 -->
<div class="span9">
<a href="#" id="mobile-menu-trigger"><i class="fa fa-bars"></i></a>
<!-- // Menu // -->
<?php include '_include/menu_top.php'; ?>
</div><!-- end .span9 -->
</div><!-- end .row -->
</div><!-- end #header -->
<!-- /// HEADER END ///////// -->

<!-- /// CONTENT ///////// -->
<div id="content">
<div id="page-header">

<div class="row">
<div class="span12">

<h2>CV Dashboard</h2>
<p>User Registration</p>

</div><!-- end .span12 -->
</div><!-- end .row -->

</div><!-- end .page-header -->
<div class="row">
<div class="row">
<div class="span12">
<div class="icon-box-1"> <i class="ifc-add_user"></i>
<div class="icon-box-content">
<h3>Agent Registration Form</h3>
<p>The Clearview Dashboard section of cvoffers.com gives you the ability to manage all your listings and offers... all from our secure, easy-to-use cloud-based system.<br>
<strong class="text-highlight">Sellers:</strong> your listing agent will create an account for you to view all offer activity related to your property.</p>

<p>&nbsp;</p>
</div>
<!-- end .icon-box-content -->
</div>
<!-- end .icon-box-1 -->
</div><!-- end .span12 -->
</div><!-- end .row -->
<!-- BEGIN FORM -->
<form action="" method="post" name="form1" onSubmit="MM_validateForm('Email','','NisEmail');return document.MM_returnValue">
<div class="row">

<div class="span6">
<p>
<label for="First_Name">First Name<span class="red">*</span>:</label>
<input name="First_Name" type="text" required="required" id="First_Name" value="<?php echo(ValidatedField("register_954","First_Name")) ?>">
</p>
<p>
<label for="Last_Name">Last Name<span class="red">*</span>:</label>
<input name="Last_Name" type="text" required="required" id="Last_Name" value="<?php echo(ValidatedField("register_954","Last_Name")) ?>">
</p>
<p>
<label for="Phone_Mobile">Mobile Phone (must be 10-digits, numbers only)<span class="red">*</span>:</label>
<span class="red">
<input name="Phone_Mobile" type="text" required="required" id="Phone_Mobile" value="<?php echo(ValidatedField("register_954","Phone_Mobile")) ?>">
<?php
if (ValidatedField('register_022','register_022')) {
if ((strpos((",".ValidatedField("register_022","register_022").","), "," . "2" . ",") !== false || "2" == "") || (strpos((",".ValidatedField("register_022","register_022").","), "," . "3" . ",") !== false || "3" == "")) {
if (!(false)) {
?>
Mobile Phone must contain 10-digit number only
<?php //WAFV_Conditional register.php register_022(2,3:)
}
}
}?>
</span></p>
<label for="networkID">Wireless Carrier<span class="red">*</span> <a class="tooltips" href="#"><img src="https://s3-us-west-1.amazonaws.com/cvoffers/_layout/images/help.png" width="15" height="15" alt=""/><span>To Receive Text Message Updates.</span></a>:</label>
<select name="networkID" required id="networkID">
<option value="" <?php if (!(strcmp("", (ValidatedField("register_954","networkID"))))) {echo "selected=\"selected\"";} ?>>-- Select One --</option>
<?php
do {
?>
<option value="<?php echo $row_rsNetwork['networkID']?>"<?php if (!(strcmp($row_rsNetwork['networkID'], (ValidatedField("register_954","networkID"))))) {echo "selected=\"selected\"";} ?>><?php echo $row_rsNetwork['networkName']?></option>
<?php
} while ($row_rsNetwork = mysql_fetch_assoc($rsNetwork));
$rows = mysql_num_rows($rsNetwork);
if($rows > 0) {
mysql_data_seek($rsNetwork, 0);
$row_rsNetwork = mysql_fetch_assoc($rsNetwork);
}
?>
</select>
</p>
<p>
<label for="Phone_Land">Direct Office Phone (if different):</label>
<input name="Phone_Land" type="text" id="Phone_Land" value="<?php echo(ValidatedField("register_954","Phone_Land")) ?>">
</p>
</div>
<!-- end .span6 -->
<div class="span6">
<p>
<label for="Email">Email<span class="red">*</span>:</label>
<input name="Email" type="text" required="required" id="Email" value="<?php echo(ValidatedField("register_954","Email")) ?>">
</p>
<p>
<label for="password">Password<span class="red">*</span>:</label>
<input name="password" type="password" required="required" id="password">
<?php
if (ValidatedField('register_954','register_954')) {
if ((strpos((",".ValidatedField("register_954","register_954").","), "," . "4" . ",") !== false || "4" == "")) {
if (!(false)) {
?>
<span class="red">Passwords don't match </span>
<?php //WAFV_Conditional register.php register_954(4:)
}
}
}?>
</p>
<p>
<label for="password2">Re-Type Password<span class="red">*</span>:</label>
<input name="password2" type="password" required id="password2">
</p>
<p>
<label for="relicense">Real Estate License Number<span class="red">*</span>:</label>
<input name="relicense" type="text" required id="relicense" value="<?php echo(ValidatedField("register_954","relicense")) ?>">
</p>
<p>
<label for="statelicense">State Licensed<span class="red">*</span>:</label>
<select name="statelicense" required id="statelicense">
<option value="AL" <?php if (!(strcmp("AL", (ValidatedField("register_954","statelicense"))))) {echo "selected=\"selected\"";} ?>>Alabama</option>
<option value="AK" <?php if (!(strcmp("AK", (ValidatedField("register_954","statelicense"))))) {echo "selected=\"selected\"";} ?>>Alaska</option>
<option value="AZ" <?php if (!(strcmp("AZ", (ValidatedField("register_954","statelicense"))))) {echo "selected=\"selected\"";} ?>>Arizona</option>
<option value="AR" <?php if (!(strcmp("AR", (ValidatedField("register_954","statelicense"))))) {echo "selected=\"selected\"";} ?>>Arkansas</option>
<option value="CA" selected="selected" <?php if (!(strcmp("CA", (ValidatedField("register_954","statelicense"))))) {echo "selected=\"selected\"";} ?>>California</option>
<option value="CO" <?php if (!(strcmp("CO", (ValidatedField("register_954","statelicense"))))) {echo "selected=\"selected\"";} ?>>Colorado</option>
<option value="CT" <?php if (!(strcmp("CT", (ValidatedField("register_954","statelicense"))))) {echo "selected=\"selected\"";} ?>>Connecticut</option>
<option value="DE" <?php if (!(strcmp("DE", (ValidatedField("register_954","statelicense"))))) {echo "selected=\"selected\"";} ?>>Delaware</option>
<option value="FL" <?php if (!(strcmp("FL", (ValidatedField("register_954","statelicense"))))) {echo "selected=\"selected\"";} ?>>Florida</option>
<option value="GA" <?php if (!(strcmp("GA", (ValidatedField("register_954","statelicense"))))) {echo "selected=\"selected\"";} ?>>Georgia</option>
<option value="HI" <?php if (!(strcmp("HI", (ValidatedField("register_954","statelicense"))))) {echo "selected=\"selected\"";} ?>>Hawaii</option>
<option value="ID" <?php if (!(strcmp("ID", (ValidatedField("register_954","statelicense"))))) {echo "selected=\"selected\"";} ?>>Idaho</option>
<option value="IL" <?php if (!(strcmp("IL", (ValidatedField("register_954","statelicense"))))) {echo "selected=\"selected\"";} ?>>Illinois</option>
<option value="IN" <?php if (!(strcmp("IN", (ValidatedField("register_954","statelicense"))))) {echo "selected=\"selected\"";} ?>>Indiana</option>
<option value="IA" <?php if (!(strcmp("IA", (ValidatedField("register_954","statelicense"))))) {echo "selected=\"selected\"";} ?>>Iowa</option>
<option value="KS" <?php if (!(strcmp("KS", (ValidatedField("register_954","statelicense"))))) {echo "selected=\"selected\"";} ?>>Kansas</option>
<option value="KY" <?php if (!(strcmp("KY", (ValidatedField("register_954","statelicense"))))) {echo "selected=\"selected\"";} ?>>Kentucky</option>
<option value="LA" <?php if (!(strcmp("LA", (ValidatedField("register_954","statelicense"))))) {echo "selected=\"selected\"";} ?>>Louisiana</option>
<option value="ME" <?php if (!(strcmp("ME", (ValidatedField("register_954","statelicense"))))) {echo "selected=\"selected\"";} ?>>Maine</option>
<option value="MD" <?php if (!(strcmp("MD", (ValidatedField("register_954","statelicense"))))) {echo "selected=\"selected\"";} ?>>Maryland</option>
<option value="MA" <?php if (!(strcmp("MA", (ValidatedField("register_954","statelicense"))))) {echo "selected=\"selected\"";} ?>>Massachusetts</option>
<option value="MI" <?php if (!(strcmp("MI", (ValidatedField("register_954","statelicense"))))) {echo "selected=\"selected\"";} ?>>Michigan</option>
<option value="MN" <?php if (!(strcmp("MN", (ValidatedField("register_954","statelicense"))))) {echo "selected=\"selected\"";} ?>>Minnesota</option>
<option value="MS" <?php if (!(strcmp("MS", (ValidatedField("register_954","statelicense"))))) {echo "selected=\"selected\"";} ?>>Mississippi</option>
<option value="MO" <?php if (!(strcmp("MO", (ValidatedField("register_954","statelicense"))))) {echo "selected=\"selected\"";} ?>>Missouri</option>
<option value="MT" <?php if (!(strcmp("MT", (ValidatedField("register_954","statelicense"))))) {echo "selected=\"selected\"";} ?>>Montana</option>
<option value="NE" <?php if (!(strcmp("NE", (ValidatedField("register_954","statelicense"))))) {echo "selected=\"selected\"";} ?>>Nebraska</option>
<option value="NV" <?php if (!(strcmp("NV", (ValidatedField("register_954","statelicense"))))) {echo "selected=\"selected\"";} ?>>Nevada</option>
<option value="NH" <?php if (!(strcmp("NH", (ValidatedField("register_954","statelicense"))))) {echo "selected=\"selected\"";} ?>>New Hampshire</option>
<option value="NJ" <?php if (!(strcmp("NJ", (ValidatedField("register_954","statelicense"))))) {echo "selected=\"selected\"";} ?>>New Jersey</option>
<option value="NM" <?php if (!(strcmp("NM", (ValidatedField("register_954","statelicense"))))) {echo "selected=\"selected\"";} ?>>New Mexico</option>
<option value="NY" <?php if (!(strcmp("NY", (ValidatedField("register_954","statelicense"))))) {echo "selected=\"selected\"";} ?>>New York</option>
<option value="NC" <?php if (!(strcmp("NC", (ValidatedField("register_954","statelicense"))))) {echo "selected=\"selected\"";} ?>>North Carolina</option>
<option value="ND" <?php if (!(strcmp("ND", (ValidatedField("register_954","statelicense"))))) {echo "selected=\"selected\"";} ?>>North Dakota</option>
<option value="OH" <?php if (!(strcmp("OH", (ValidatedField("register_954","statelicense"))))) {echo "selected=\"selected\"";} ?>>Ohio</option>
<option value="OK" <?php if (!(strcmp("OK", (ValidatedField("register_954","statelicense"))))) {echo "selected=\"selected\"";} ?>>Oklahoma</option>
<option value="OR" <?php if (!(strcmp("OR", (ValidatedField("register_954","statelicense"))))) {echo "selected=\"selected\"";} ?>>Oregon</option>
<option value="PA" <?php if (!(strcmp("PA", (ValidatedField("register_954","statelicense"))))) {echo "selected=\"selected\"";} ?>>Pennsylvania</option>
<option value="RI" <?php if (!(strcmp("RI", (ValidatedField("register_954","statelicense"))))) {echo "selected=\"selected\"";} ?>>Rhode Island</option>
<option value="SC" <?php if (!(strcmp("SC", (ValidatedField("register_954","statelicense"))))) {echo "selected=\"selected\"";} ?>>South Carolina</option>
<option value="SD" <?php if (!(strcmp("SD", (ValidatedField("register_954","statelicense"))))) {echo "selected=\"selected\"";} ?>>South Dakota</option>
<option value="TN" <?php if (!(strcmp("TN", (ValidatedField("register_954","statelicense"))))) {echo "selected=\"selected\"";} ?>>Tennessee</option>
<option value="TX" <?php if (!(strcmp("TX", (ValidatedField("register_954","statelicense"))))) {echo "selected=\"selected\"";} ?>>Texas</option>
<option value="UT" <?php if (!(strcmp("UT", (ValidatedField("register_954","statelicense"))))) {echo "selected=\"selected\"";} ?>>Utah</option>
<option value="VT" <?php if (!(strcmp("VT", (ValidatedField("register_954","statelicense"))))) {echo "selected=\"selected\"";} ?>>Vermont</option>
<option value="VA" <?php if (!(strcmp("VA", (ValidatedField("register_954","statelicense"))))) {echo "selected=\"selected\"";} ?>>Virginia</option>
<option value="WA" <?php if (!(strcmp("WA", (ValidatedField("register_954","statelicense"))))) {echo "selected=\"selected\"";} ?>>Washington</option>
<option value="WV" <?php if (!(strcmp("WV", (ValidatedField("register_954","statelicense"))))) {echo "selected=\"selected\"";} ?>>West Virginia</option>
<option value="WI" <?php if (!(strcmp("WI", (ValidatedField("register_954","statelicense"))))) {echo "selected=\"selected\"";} ?>>Wisconsin</option>
<option value="WY" <?php if (!(strcmp("WY", (ValidatedField("register_954","statelicense"))))) {echo "selected=\"selected\"";} ?>>Wyoming</option>
</select>
</p>
</div>
<hr>
<!-- end .span6 -->

</div><!-- end .row --><!-- end .span12 -->
<div class="row">
<div class="span6">
<p>
<label for="brokerageName">Brokerage Name<span class="red">*</span>:</label>
<input name="brokerageName" type="text" required id="brokerageName" value="<?php echo(ValidatedField("register_954","brokerageName")) ?>">
</p>
<p>
<label for="brokerPhone">Brokerage Phone<span class="red">*</span>:</label>
<input name="brokerPhone" type="text" required id="brokerPhone" value="<?php echo(ValidatedField("register_954","brokerPhone")) ?>">
</p>
<p>
<label for="brokerFax">Brokerage Fax:</label>
<input name="brokerFax" type="text" id="brokerPhone" value="<?php echo(ValidatedField("register_954","brokerFax")) ?>">
</p>
<p>
<label for="brokerSite">Brokerage Website:</label>
<input name="brokerSite" type="text" id="brokerSite" value="<?php echo(ValidatedField("register_954","brokerSite")) ?>">
</p>
</div>

<div class="span6">
<p>
<label for="brokerAddress">Brokerage Address<span class="red">*</span>:</label>
<input name="brokerAddress" type="text" required id="brokerAddress" value="<?php echo(ValidatedField("register_954","brokerAddress")) ?>">
</p>
<p>
<label for="brokerCity">Brokerage City<span class="red">*</span>:</label>
<input name="brokerCity" type="text" required id="brokerCity" value="<?php echo(ValidatedField("register_954","brokerCity")) ?>">
</p>
<p>
<label for="brokerState">Brokerage State<span class="red">*</span>:</label>
<select name="brokerState" required id="brokerState">
<option value="AL" <?php if (!(strcmp("AL", (ValidatedField("register_954","brokerState"))))) {echo "selected=\"selected\"";} ?>>Alabama</option>
<option value="AK" <?php if (!(strcmp("AK", (ValidatedField("register_954","brokerState"))))) {echo "selected=\"selected\"";} ?>>Alaska</option>
<option value="AZ" <?php if (!(strcmp("AZ", (ValidatedField("register_954","brokerState"))))) {echo "selected=\"selected\"";} ?>>Arizona</option>
<option value="AR" <?php if (!(strcmp("AR", (ValidatedField("register_954","brokerState"))))) {echo "selected=\"selected\"";} ?>>Arkansas</option>
<option value="CA" selected="selected" <?php if (!(strcmp("CA", (ValidatedField("register_954","brokerState"))))) {echo "selected=\"selected\"";} ?>>California</option>
<option value="CO" <?php if (!(strcmp("CO", (ValidatedField("register_954","brokerState"))))) {echo "selected=\"selected\"";} ?>>Colorado</option>
<option value="CT" <?php if (!(strcmp("CT", (ValidatedField("register_954","brokerState"))))) {echo "selected=\"selected\"";} ?>>Connecticut</option>
<option value="DE" <?php if (!(strcmp("DE", (ValidatedField("register_954","brokerState"))))) {echo "selected=\"selected\"";} ?>>Delaware</option>
<option value="DC" <?php if (!(strcmp("DC", (ValidatedField("register_954","brokerState"))))) {echo "selected=\"selected\"";} ?>>District Of Columbia</option>
<option value="FL" <?php if (!(strcmp("FL", (ValidatedField("register_954","brokerState"))))) {echo "selected=\"selected\"";} ?>>Florida</option>
<option value="GA" <?php if (!(strcmp("GA", (ValidatedField("register_954","brokerState"))))) {echo "selected=\"selected\"";} ?>>Georgia</option>
<option value="HI" <?php if (!(strcmp("HI", (ValidatedField("register_954","brokerState"))))) {echo "selected=\"selected\"";} ?>>Hawaii</option>
<option value="ID" <?php if (!(strcmp("ID", (ValidatedField("register_954","brokerState"))))) {echo "selected=\"selected\"";} ?>>Idaho</option>
<option value="IL" <?php if (!(strcmp("IL", (ValidatedField("register_954","brokerState"))))) {echo "selected=\"selected\"";} ?>>Illinois</option>
<option value="IN" <?php if (!(strcmp("IN", (ValidatedField("register_954","brokerState"))))) {echo "selected=\"selected\"";} ?>>Indiana</option>
<option value="IA" <?php if (!(strcmp("IA", (ValidatedField("register_954","brokerState"))))) {echo "selected=\"selected\"";} ?>>Iowa</option>
<option value="KS" <?php if (!(strcmp("KS", (ValidatedField("register_954","brokerState"))))) {echo "selected=\"selected\"";} ?>>Kansas</option>
<option value="KY" <?php if (!(strcmp("KY", (ValidatedField("register_954","brokerState"))))) {echo "selected=\"selected\"";} ?>>Kentucky</option>
<option value="LA" <?php if (!(strcmp("LA", (ValidatedField("register_954","brokerState"))))) {echo "selected=\"selected\"";} ?>>Louisiana</option>
<option value="ME" <?php if (!(strcmp("ME", (ValidatedField("register_954","brokerState"))))) {echo "selected=\"selected\"";} ?>>Maine</option>
<option value="MD" <?php if (!(strcmp("MD", (ValidatedField("register_954","brokerState"))))) {echo "selected=\"selected\"";} ?>>Maryland</option>
<option value="MA" <?php if (!(strcmp("MA", (ValidatedField("register_954","brokerState"))))) {echo "selected=\"selected\"";} ?>>Massachusetts</option>
<option value="MI" <?php if (!(strcmp("MI", (ValidatedField("register_954","brokerState"))))) {echo "selected=\"selected\"";} ?>>Michigan</option>
<option value="MN" <?php if (!(strcmp("MN", (ValidatedField("register_954","brokerState"))))) {echo "selected=\"selected\"";} ?>>Minnesota</option>
<option value="MS" <?php if (!(strcmp("MS", (ValidatedField("register_954","brokerState"))))) {echo "selected=\"selected\"";} ?>>Mississippi</option>
<option value="MO" <?php if (!(strcmp("MO", (ValidatedField("register_954","brokerState"))))) {echo "selected=\"selected\"";} ?>>Missouri</option>
<option value="MT" <?php if (!(strcmp("MT", (ValidatedField("register_954","brokerState"))))) {echo "selected=\"selected\"";} ?>>Montana</option>
<option value="NE" <?php if (!(strcmp("NE", (ValidatedField("register_954","brokerState"))))) {echo "selected=\"selected\"";} ?>>Nebraska</option>
<option value="NV" <?php if (!(strcmp("NV", (ValidatedField("register_954","brokerState"))))) {echo "selected=\"selected\"";} ?>>Nevada</option>
<option value="NH" <?php if (!(strcmp("NH", (ValidatedField("register_954","brokerState"))))) {echo "selected=\"selected\"";} ?>>New Hampshire</option>
<option value="NJ" <?php if (!(strcmp("NJ", (ValidatedField("register_954","brokerState"))))) {echo "selected=\"selected\"";} ?>>New Jersey</option>
<option value="NM" <?php if (!(strcmp("NM", (ValidatedField("register_954","brokerState"))))) {echo "selected=\"selected\"";} ?>>New Mexico</option>
<option value="NY" <?php if (!(strcmp("NY", (ValidatedField("register_954","brokerState"))))) {echo "selected=\"selected\"";} ?>>New York</option>
<option value="NC" <?php if (!(strcmp("NC", (ValidatedField("register_954","brokerState"))))) {echo "selected=\"selected\"";} ?>>North Carolina</option>
<option value="ND" <?php if (!(strcmp("ND", (ValidatedField("register_954","brokerState"))))) {echo "selected=\"selected\"";} ?>>North Dakota</option>
<option value="OH" <?php if (!(strcmp("OH", (ValidatedField("register_954","brokerState"))))) {echo "selected=\"selected\"";} ?>>Ohio</option>
<option value="OK" <?php if (!(strcmp("OK", (ValidatedField("register_954","brokerState"))))) {echo "selected=\"selected\"";} ?>>Oklahoma</option>
<option value="OR" <?php if (!(strcmp("OR", (ValidatedField("register_954","brokerState"))))) {echo "selected=\"selected\"";} ?>>Oregon</option>
<option value="PA" <?php if (!(strcmp("PA", (ValidatedField("register_954","brokerState"))))) {echo "selected=\"selected\"";} ?>>Pennsylvania</option>
<option value="RI" <?php if (!(strcmp("RI", (ValidatedField("register_954","brokerState"))))) {echo "selected=\"selected\"";} ?>>Rhode Island</option>
<option value="SC" <?php if (!(strcmp("SC", (ValidatedField("register_954","brokerState"))))) {echo "selected=\"selected\"";} ?>>South Carolina</option>
<option value="SD" <?php if (!(strcmp("SD", (ValidatedField("register_954","brokerState"))))) {echo "selected=\"selected\"";} ?>>South Dakota</option>
<option value="TN" <?php if (!(strcmp("TN", (ValidatedField("register_954","brokerState"))))) {echo "selected=\"selected\"";} ?>>Tennessee</option>
<option value="TX" <?php if (!(strcmp("TX", (ValidatedField("register_954","brokerState"))))) {echo "selected=\"selected\"";} ?>>Texas</option>
<option value="UT" <?php if (!(strcmp("UT", (ValidatedField("register_954","brokerState"))))) {echo "selected=\"selected\"";} ?>>Utah</option>
<option value="VT" <?php if (!(strcmp("VT", (ValidatedField("register_954","brokerState"))))) {echo "selected=\"selected\"";} ?>>Vermont</option>
<option value="VA" <?php if (!(strcmp("VA", (ValidatedField("register_954","brokerState"))))) {echo "selected=\"selected\"";} ?>>Virginia</option>
<option value="WA" <?php if (!(strcmp("WA", (ValidatedField("register_954","brokerState"))))) {echo "selected=\"selected\"";} ?>>Washington</option>
<option value="WV" <?php if (!(strcmp("WV", (ValidatedField("register_954","brokerState"))))) {echo "selected=\"selected\"";} ?>>West Virginia</option>
<option value="WI" <?php if (!(strcmp("WI", (ValidatedField("register_954","brokerState"))))) {echo "selected=\"selected\"";} ?>>Wisconsin</option>
<option value="WY" <?php if (!(strcmp("WY", (ValidatedField("register_954","brokerState"))))) {echo "selected=\"selected\"";} ?>>Wyoming</option>
</select>
</p>
<p>
<label for="brokerZip">Brokerage Zip Code<span class="red">*</span>:</label>
<input name="brokerZip" type="text" required id="brokerZip" value="<?php echo(ValidatedField("register_954","brokerZip")) ?>">
</p>

</div>

</div>

<div class="row">
<div class="span6">
<p class="red">* Required</p>
<p><img id="capt1" src="webassist/captcha/wavt_captchasecurityimages.php?width=200&height=50&field=Security_Code_1&bgcolor=FFFFFF&transparent=0&bgimage=&gridfreq=20&gridcolor=000000&gridorder=behind&noisefreq=20&noisecolor=000000&noiseorder=behind&characters=5&charheight=&font=fonts/MOM_T___.TTF&textcolor=000000" alt="security code" width="200" height="50" /><img src="webassist/captcha/images/refresh.png" height="18" onClick="document.getElementById('capt1').src+='&ref=1'"><br>
<label for="Security_Code_1">Enter the characters as they appear in the image above:<span class="red">*</span></label>
<input id="Security_Code_1" name="Security_Code_1" type="text" value="" />
<?php
if (ValidatedField('register_846','register_846')) {
if ((strpos((",".ValidatedField("register_846","register_846").","), "," . "1" . ",") !== false || "1" == "")) {
if (!(false)) {
?>
<span class="red">Characters entered did not match image above.</span>
<?php //WAFV_Conditional register.php register_846(1:)
}
}
}?>
</p>
<p>
<input name="submit" type="submit" class="neoSubmitButton" id="submit" value="Register">
</p>
</div>
</div>
</form>
<!-- END FORM -->
</div>
<!-- end .row -->


</div><!-- end #content -->
<!-- /// CONTENT END ///////// -->

<!-- /// FOOTER-BOTTOM ///////// -->
<div id="footer-bottom">
<div class="row">
<?php include '_include/menu_footer.php'; ?>
</div><!-- end .row -->
</div>
<!-- /// FOOTER-BOTTOM END ///////// -->

</div><!-- end #wrap -->

<a id="back-to-top" href="#"><i class="fa fa-angle-up"></i></a>

<script src="https://s3-us-west-1.amazonaws.com/cvoffers/_layout/js/jquery-2.1.1.min.js"></script>
<script src="https://s3-us-west-1.amazonaws.com/cvoffers/_layout/js/viewport/jquery.viewport.js"></script>
<script src="https://s3-us-west-1.amazonaws.com/cvoffers/_layout/js/easing/jquery.easing.1.3.js"></script>
<script src="https://s3-us-west-1.amazonaws.com/cvoffers/_layout/js/scripts.js"></script>
</body>
</html>
<?php
mysql_free_result($rsNetwork);
?>

Sign in to reply to this post

Ray BorduinWebAssist

You should really attach php pages instead of copy and pasting their contents so that I can open them in Dreamweaver.

Anyway the problem is that you are using separate server validation extensions for each field... instead you should just use one server behavior and validate all of the fields.

php:
<?php

if ($_SERVER["REQUEST_METHOD"] == "POST") {
$WAFV_Redirect "reg_error_email.php";
$_SESSION['WAVT_register_697_Errors'] = "";
if (
$WAFV_Redirect == "") {
$WAFV_Redirect $_SERVER["PHP_SELF"];
}
$WAFV_Errors "";
$WAFV_Errors .= WAValidateUnique("connData",$connData,$database_connData,"mycv","ID","none,none,NULL","0","email","',none,''","".(((isset($_POST["Email"]))?$_POST["Email"]:"")) ."",true,5);

if (
$WAFV_Errors != "") {
PostResult($WAFV_Redirect,$WAFV_Errors,"register_697");
}
}
?>
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$WAFV_Redirect "register.php";
$_SESSION['WAVT_register_954_Errors'] = "";
if (
$WAFV_Redirect == "") {
$WAFV_Redirect $_SERVER["PHP_SELF"];
}
$WAFV_Errors "";
$WAFV_Errors .= WAValidateLE(((isset($_POST["password"]))?$_POST["password"]:"") . "",((isset($_POST["password2"]))?$_POST["password2"]:"") . "",true,4);

if (
$WAFV_Errors != "") {
PostResult($WAFV_Redirect,$WAFV_Errors,"register_954");
}
}
?>
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$WAFV_Redirect "register.php";
$_SESSION['WAVT_register_022_Errors'] = "";
if (
$WAFV_Redirect == "") {
$WAFV_Redirect $_SERVER["PHP_SELF"];
}
$WAFV_Errors "";
$WAFV_Errors .= WAValidateAN(((isset($_POST["Phone_Mobile"]))?$_POST["Phone_Mobile"]:"") . "",false,false,true,false,"",true,2);
$WAFV_Errors .= WAValidateEL(((isset($_POST["Phone_Mobile"]))?$_POST["Phone_Mobile"]:"") . "",10,10,true,3);

if (
$WAFV_Errors != "") {
PostResult($WAFV_Redirect,$WAFV_Errors,"register_022");
}
}
?>
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$WAFV_Redirect "register.php";
$_SESSION['WAVT_register_846_Errors'] = "";
if (
$WAFV_Redirect == "") {
$WAFV_Redirect $_SERVER["PHP_SELF"];
}
$WAFV_Errors "";
$WAFV_Errors .= WAValidateLE(strtolower($_SESSION['captcha_Security_Code_1']) . "",strtolower(((isset($_POST["Security_Code_1"]))?$_POST["Security_Code_1"]:"")) . "",true,1);

if (
$WAFV_Errors != "") {
PostResult($WAFV_Redirect,$WAFV_Errors,"register_846");
}
}
?>



should be updated to:

php:
<?php

if ($_SERVER["REQUEST_METHOD"] == "POST") {
$WAFV_Redirect "register.php";
$_SESSION['WAVT_register_954_Errors'] = "";
if (
$WAFV_Redirect == "") {
$WAFV_Redirect $_SERVER["PHP_SELF"];
}
$WAFV_Errors "";
$WAFV_Errors .= WAValidateLE(strtolower($_SESSION['captcha_Security_Code_1']) . "",strtolower(((isset($_POST["Security_Code_1"]))?$_POST["Security_Code_1"]:"")) . "",true,1);
$WAFV_Errors .= WAValidateAN(((isset($_POST["Phone_Mobile"]))?$_POST["Phone_Mobile"]:"") . "",false,false,true,false,"",true,2);
$WAFV_Errors .= WAValidateEL(((isset($_POST["Phone_Mobile"]))?$_POST["Phone_Mobile"]:"") . "",10,10,true,3);
$WAFV_Errors .= WAValidateLE(((isset($_POST["password"]))?$_POST["password"]:"") . "",((isset($_POST["password2"]))?$_POST["password2"]:"") . "",true,4);
$WAFV_Errors .= WAValidateUnique("connData",$connData,$database_connData,"mycv","ID","none,none,NULL","0","email","',none,''","".(((isset($_POST["Email"]))?$_POST["Email"]:"")) ."",true,5);

if (
$WAFV_Errors != "") {
PostResult($WAFV_Redirect,$WAFV_Errors,"register_954");
}
}
?>
Sign in to reply to this post
Did this help? Tips are appreciated...

Armen

Thanks Ray,

I implemented the code. However, the Captcha seems to no longer work. The page just reloads itself. I've included a link in the private comments below as well as attached the php file.

Sign in to reply to this post

Ray BorduinWebAssist

I was able to register without any issues.

Sign in to reply to this post
Did this help? Tips are appreciated...

Armen

I restarted my browser and it now works. Thanks.

Sign in to reply to this 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...