close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

DataAssist Insert Form Send hidden field in email

Thread began 10/12/2014 9:03 am by LWag48648773 | Last modified 11/04/2014 9:58 am by LWag48648773 | 3439 views | 9 replies

LWag48648773

<?php require_once("webassist/form_validations/wavt_scripts_php.php"); ?>
<?php require_once('Connections/connMoonshine.php'); ?>
<?php require_once("webassist/form_validations/wavt_validatedform_php.php"); ?>
<?php
if ((isset($_POST["Insert"]) || isset($_POST["Insert_x"]))) {
$WAFV_Redirect = "".(htmlentities($_SERVER["PHP_SELF"], ENT_QUOTES)) ."?invalid=true";
$_SESSION['WAVT_join_Errors'] = "";
if ($WAFV_Redirect == "") {
$WAFV_Redirect = $_SERVER["PHP_SELF"];
}
$WAFV_Errors = "";
$WAFV_Errors .= WAValidateNM((isset($_POST["member_id"])?$_POST["member_id"]:"") . "","","",0,",.",false,1);
$WAFV_Errors .= WAValidateRQ((isset($_POST["first_name"])?$_POST["first_name"]:"") . "",true,2);
$WAFV_Errors .= WAValidateRQ((isset($_POST["last_name"])?$_POST["last_name"]:"") . "",true,3);
$WAFV_Errors .= WAValidateEM((isset($_POST["email"])?$_POST["email"]:"") . "",true,4);
$WAFV_Errors .= WAValidateZC((isset($_POST["zip_code"])?$_POST["zip_code"]:"") . "",true,false,false,false,true,5);

if ($WAFV_Errors != "") {
PostResult($WAFV_Redirect,$WAFV_Errors,"join");
}
}
?>
<?php require_once("webassist/database_management/wa_appbuilder_php.php"); ?>
<?php require_once("webassist/email/mail_php.php"); ?>
<?php require_once("webassist/email/mailformatting_php.php"); ?>
<?php
// WA DataAssist Insert
if (isset($_POST["Insert"]) || isset($_POST["Insert_x"])) // Trigger
{
$WA_connection = $connMoonshine;
$WA_table = "Members";
$WA_sessionName = "WADA_Insert_Members";
$WA_redirectURL = "join-TY.php";
if (function_exists("rel2abs")) $WA_redirectURL = $WA_redirectURL?rel2abs($WA_redirectURL,dirname(__FILE__)):"";
$WA_keepQueryString = false;
$WA_fieldNamesStr = "member_id|first_name|last_name|email|zip_code";
$WA_fieldValuesStr = "".((isset($_POST["member_id"]))?$_POST["member_id"]:"") ."" . $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["email"]))?$_POST["email"]:"") ."" . $WA_AB_Split . "".((isset($_POST["zip_code"]))?$_POST["zip_code"]:"") ."";
$WA_columnTypesStr = "',none,''|',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_connMoonshine;
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);
}
}
?>
<?php
if ((isset($_POST["Insert"]) || isset($_POST["Insert_x"]))) {
//WA Universal Email object="mail"
@session_write_close();
set_time_limit(0);
$EmailRef = "waue_join_1";
$BurstSize = 200;
$BurstTime = 1;
$WaitTime = 1;
$GoToPage = "join-TY.php";
$RecipArray = array();
$StartBurst = time();
$LoopCount = 0;
$TotalEmails = 0;
$RecipIndex = 0;
// build up recipients array
$CurIndex = sizeof($RecipArray);
$RecipArray[$CurIndex] = array();
$RecipArray[$CurIndex ][] = "".((isset($_POST["email"]))?$_POST["email"]:"") ."";
$TotalEmails += sizeof($RecipArray[$CurIndex]);
$RealWait = ($WaitTime<0.25)?0.25:($WaitTime+0.1);
$TimeTracker = Array();
$TotalBursts = floor($TotalEmails/$BurstSize);
$AfterBursts = $TotalEmails % $BurstSize;
$TimeRemaining = ($TotalBursts * $BurstTime) + ($AfterBursts*$RealWait);
if ($TimeRemaining < ($TotalEmails*$RealWait) ) {
$TimeRemaining = $TotalEmails*$RealWait;
}
writeUEProgress($EmailRef,0,$TotalEmails,$TimeRemaining);
while ($RecipIndex < sizeof($RecipArray)) {
$EnteredValue = is_string($RecipArray[$RecipIndex][0]);
$CurIndex = 0;
while (($EnteredValue && $CurIndex < sizeof($RecipArray[$RecipIndex])) || (!$EnteredValue && $RecipArray[$RecipIndex][0])) {
$starttime = microtime_float();
if ($EnteredValue) {
$RecipientEmail = $RecipArray[$RecipIndex][$CurIndex];
} else {
$RecipientEmail = $RecipArray[$RecipIndex][0][$RecipArray[$RecipIndex][2]];
}
$EmailsRemaining = ($TotalEmails- $LoopCount);
$BurstsRemaining = ceil(($EmailsRemaining-$AfterBursts)/$BurstSize);
$IntoBurst = ($EmailsRemaining-$AfterBursts) % $BurstSize;
if ($AfterBursts<$EmailsRemaining) $IntoBurst = 0;
$TimeRemaining = ($BurstsRemaining * $BurstTime * 60) + ((($AfterBursts<$EmailsRemaining)?$AfterBursts:$EmailsRemaining)*$RealWait) - (($AfterBursts>$EmailsRemaining)?0:($IntoBurst*$RealWait));
if ($TimeRemaining < ($EmailsRemaining*$RealWait) ) {
$TimeRemaining = $EmailsRemaining*$RealWait;
}
$CurIndex ++;
$LoopCount ++;
writeUEProgress($EmailRef,$LoopCount,$TotalEmails,round($TimeRemaining));
wa_sleep($WaitTime);
include("webassist/email/waue_join_1.php");
$endtime = microtime_float();
$TimeTracker[] =$endtime - $starttime;
$RealWait = array_sum($TimeTracker)/sizeof($TimeTracker);
if ($LoopCount % $BurstSize == 0 && $CurIndex < sizeof($RecipArray[$RecipIndex])) {
$TimePassed = (time() - $StartBurst);
if ($TimePassed < ($BurstTime*60)) {
$WaitBurst = ($BurstTime*60) -$TimePassed;
wa_sleep($WaitBurst);
}
else {
$TimeRemaining = ($TotalEmails- $LoopCount)*$RealWait;
}
$StartBurst = time();
}
if (!$EnteredValue) {
$RecipArray[$RecipIndex][0] = mysql_fetch_assoc($RecipArray[$RecipIndex][1]);
}
}
$RecipIndex ++;
}
@session_start();
$_SESSION[$EmailRef."_Status"] = $GLOBALS[$EmailRef."_Status"];
$_SESSION[$EmailRef."_Index"] = $GLOBALS[$EmailRef."_Index"];
$_SESSION[$EmailRef."_From"] = $GLOBALS[$EmailRef."_From"];
$_SESSION[$EmailRef."_To"] = $GLOBALS[$EmailRef."_To"];
$_SESSION[$EmailRef."_Subject"] = $GLOBALS[$EmailRef."_Subject"];
$_SESSION[$EmailRef."_Body"] = $GLOBALS[$EmailRef."_Body"];
$_SESSION[$EmailRef."_Header"] = $GLOBALS[$EmailRef."_Header"];
$_SESSION[$EmailRef."_Log"] = $GLOBALS[$EmailRef."_Log"];
if (function_exists("rel2abs")) $GoToPage = $GoToPage?rel2abs($GoToPage,dirname(__FILE__)):"";
if ($GoToPage!="") {
header("Location: ".$GoToPage);
}
}
?>
<?php
if ((isset($_POST["Insert"]) || isset($_POST["Insert_x"]))) {
//WA Universal Email object="mail"
@session_write_close();
set_time_limit(0);
$EmailRef = "waue_join_2";
$BurstSize = 200;
$BurstTime = 1;
$WaitTime = 1;
$GoToPage = "join-TY.php";
$RecipArray = array();
$StartBurst = time();
$LoopCount = 0;
$TotalEmails = 0;
$RecipIndex = 0;
// build up recipients array
$CurIndex = sizeof($RecipArray);
$RecipArray[$CurIndex] = array();
$RecipArray[$CurIndex ][] = "".((isset($_POST["email"]))?$_POST["email"]:"") ."";
$TotalEmails += sizeof($RecipArray[$CurIndex]);
$RealWait = ($WaitTime<0.25)?0.25:($WaitTime+0.1);
$TimeTracker = Array();
$TotalBursts = floor($TotalEmails/$BurstSize);
$AfterBursts = $TotalEmails % $BurstSize;
$TimeRemaining = ($TotalBursts * $BurstTime) + ($AfterBursts*$RealWait);
if ($TimeRemaining < ($TotalEmails*$RealWait) ) {
$TimeRemaining = $TotalEmails*$RealWait;
}
writeUEProgress($EmailRef,0,$TotalEmails,$TimeRemaining);
while ($RecipIndex < sizeof($RecipArray)) {
$EnteredValue = is_string($RecipArray[$RecipIndex][0]);
$CurIndex = 0;
while (($EnteredValue && $CurIndex < sizeof($RecipArray[$RecipIndex])) || (!$EnteredValue && $RecipArray[$RecipIndex][0])) {
$starttime = microtime_float();
if ($EnteredValue) {
$RecipientEmail = $RecipArray[$RecipIndex][$CurIndex];
} else {
$RecipientEmail = $RecipArray[$RecipIndex][0][$RecipArray[$RecipIndex][2]];
}
$EmailsRemaining = ($TotalEmails- $LoopCount);
$BurstsRemaining = ceil(($EmailsRemaining-$AfterBursts)/$BurstSize);
$IntoBurst = ($EmailsRemaining-$AfterBursts) % $BurstSize;
if ($AfterBursts<$EmailsRemaining) $IntoBurst = 0;
$TimeRemaining = ($BurstsRemaining * $BurstTime * 60) + ((($AfterBursts<$EmailsRemaining)?$AfterBursts:$EmailsRemaining)*$RealWait) - (($AfterBursts>$EmailsRemaining)?0:($IntoBurst*$RealWait));
if ($TimeRemaining < ($EmailsRemaining*$RealWait) ) {
$TimeRemaining = $EmailsRemaining*$RealWait;
}
$CurIndex ++;
$LoopCount ++;
writeUEProgress($EmailRef,$LoopCount,$TotalEmails,round($TimeRemaining));
wa_sleep($WaitTime);
include("webassist/email/waue_join_2.php");
$endtime = microtime_float();
$TimeTracker[] =$endtime - $starttime;
$RealWait = array_sum($TimeTracker)/sizeof($TimeTracker);
if ($LoopCount % $BurstSize == 0 && $CurIndex < sizeof($RecipArray[$RecipIndex])) {
$TimePassed = (time() - $StartBurst);
if ($TimePassed < ($BurstTime*60)) {
$WaitBurst = ($BurstTime*60) -$TimePassed;
wa_sleep($WaitBurst);
}
else {
$TimeRemaining = ($TotalEmails- $LoopCount)*$RealWait;
}
$StartBurst = time();
}
if (!$EnteredValue) {
$RecipArray[$RecipIndex][0] = mysql_fetch_assoc($RecipArray[$RecipIndex][1]);
}
}
$RecipIndex ++;
}
@session_start();
$_SESSION[$EmailRef."_Status"] = $GLOBALS[$EmailRef."_Status"];
$_SESSION[$EmailRef."_Index"] = $GLOBALS[$EmailRef."_Index"];
$_SESSION[$EmailRef."_From"] = $GLOBALS[$EmailRef."_From"];
$_SESSION[$EmailRef."_To"] = $GLOBALS[$EmailRef."_To"];
$_SESSION[$EmailRef."_Subject"] = $GLOBALS[$EmailRef."_Subject"];
$_SESSION[$EmailRef."_Body"] = $GLOBALS[$EmailRef."_Body"];
$_SESSION[$EmailRef."_Header"] = $GLOBALS[$EmailRef."_Header"];
$_SESSION[$EmailRef."_Log"] = $GLOBALS[$EmailRef."_Log"];
if (function_exists("rel2abs")) $GoToPage = $GoToPage?rel2abs($GoToPage,dirname(__FILE__)):"";
if ($GoToPage!="") {
header("Location: ".$GoToPage);
}
}
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<link href='http://fonts.googleapis.com/css?family=Ubuntu:400,700' rel='stylesheet' type='text/css'>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Moonshine Network New Member Registration</title>
<link rel="stylesheet" type="text/css" href="css/styles.css">
<link rel="stylesheet" type="text/css" href="css/menu.css">
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<script src="webassist/progress_bar/jquery-blockui-formprocessing.js" type="text/javascript"></script>

<link href="webassist/forms/fd_sidebar_default.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="webassist/jq_validation/Bloom.css">

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js"></script>
<link href="webassist/forms/dataassist_button.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="wrapper100">
<div class="head_line"></div>
<div class="wrapper">
<div class="logo"><?php require_once('includes/logo.php'); ?>
<!-- end logo --></div>
<!-- head_block --><div class="head_block">
<div class="nav-top">
<?php require_once('includes/nav-top.php'); ?>
<!-- end nav --></div>
<div class="header">
<div class="tag"><?php require_once('includes/tag.php'); ?>
<!-- end phone --></div>
<!-- //header --></div>
<div class="clear"></div>
<!-- end head_block --></div>
<div class="clear"></div>
<!-- main nav -->
<?php require_once('includes/main-nav.php'); ?>
<!-- end main nav -->
<div class="main">
<p align="center"><b>Please complete the information below. <br>
Your Moonshine Network Member ID will be emailed to you.</b></p>
<div align="center" id="Insert_Sidebar_Default_ProgressWrapper">
<form class="Sidebar_Default" id="Insert_Sidebar_Default" name="Insert_Sidebar_Default" method="post" action="<?php echo (htmlentities($_SERVER["PHP_SELF"], ENT_QUOTES)); ?>">
<ul class="Sidebar_Default">
<li>
<fieldset class="Sidebar_Default" id="Insert">
<ul class="formList">
<li class="formItem">
<div class="formGroup">
<div class="lineGroup">
<!--<div class="fullColumnGroup"><label for="member_id" class="sublabel" >Member ID:</label>
<input id="member_id" name="member_id" type="text" value="<?php echo((isset($_GET["invalid"])?ValidatedField("join","member_id"):"")); ?>" class="formTextfield_Medium" tabindex="1" title="Please enter a value.">
<?php
if (ValidatedField('join','join')) {
if ((strpos((",".ValidatedField("join","join").","), "," . "1" . ",") !== false || "1" == "")) {
if (!(false)) {
?><span class="serverInvalidState" id="member_id_ServerError">Please enter a value.</span><?php //WAFV_Conditional join.php join(1:)
}
}
}?>
</div>-->
</div>
</div>
</li>
<li class="formItem">
<div class="formGroup">
<div class="lineGroup">
<div class="fullColumnGroup"><label for="first_name" class="sublabel" >First Name:<span class="requiredIndicator">&nbsp;*</span></label>
<input id="first_name" name="first_name" type="text" value="<?php echo((isset($_GET["invalid"])?ValidatedField("join","first_name"):"")); ?>" class="formTextfield_Medium" tabindex="2" title="Please enter a value." required>
<?php
if (ValidatedField('join','join')) {
if ((strpos((",".ValidatedField("join","join").","), "," . "2" . ",") !== false || "2" == "")) {
if (!(false)) {
?><span class="serverInvalidState" id="first_name_ServerError">Please enter a value.</span><?php //WAFV_Conditional join.php join(2:)
}
}
}?>
</div>
</div>
</div>
</li>
<li class="formItem">
<div class="formGroup">
<div class="lineGroup">
<div class="fullColumnGroup"><label for="last_name" class="sublabel" >Last Name:<span class="requiredIndicator">&nbsp;*</span></label>
<input id="last_name" name="last_name" type="text" value="<?php echo((isset($_GET["invalid"])?ValidatedField("join","last_name"):"")); ?>" class="formTextfield_Medium" tabindex="3" title="Please enter a value." required>
<?php
if (ValidatedField('join','join')) {
if ((strpos((",".ValidatedField("join","join").","), "," . "3" . ",") !== false || "3" == "")) {
if (!(false)) {
?><span class="serverInvalidState" id="last_name_ServerError">Please enter a value.</span><?php //WAFV_Conditional join.php join(3:)
}
}
}?>
</div>
</div>
</div>
</li>
<li class="formItem">
<div class="formGroup">
<div class="lineGroup">
<div class="fullColumnGroup"><label for="email" class="sublabel" >Email Address:<span class="requiredIndicator">&nbsp;*</span></label>
<input id="email" name="email" type="text" value="<?php echo((isset($_GET["invalid"])?ValidatedField("join","email"):"")); ?>" class="formTextfield_Medium" tabindex="4" pattern="[^@]+@[^@]+\.[a-zA-Z]{2,6}" title="Please enter a value." required>
<?php
if (ValidatedField('join','join')) {
if ((strpos((",".ValidatedField("join","join").","), "," . "4" . ",") !== false || "4" == "")) {
if (!(false)) {
?><span class="serverInvalidState" id="email_ServerError">Please enter a value.</span><?php //WAFV_Conditional join.php join(4:)
}
}
}?>
</div>
</div>
</div>
</li>
<li class="formItem">
<div class="formGroup">
<div class="lineGroup">
<div class="fullColumnGroup"><label for="zip_code" class="sublabel" >Zip Code:<span class="requiredIndicator">&nbsp;*</span></label>
<input id="zip_code" name="zip_code" type="text" value="<?php echo((isset($_GET["invalid"])?ValidatedField("join","zip_code"):"")); ?>" class="formTextfield_Medium" tabindex="5" pattern="(\d{5}([\-]\d{4})?)" title="Please enter a value." required>
<?php
if (ValidatedField('join','join')) {
if ((strpos((",".ValidatedField("join","join").","), "," . "5" . ",") !== false || "5" == "")) {
if (!(false)) {
?><span class="serverInvalidState" id="zip_code_ServerError">Please enter a value.</span><?php //WAFV_Conditional join.php join(5:)
}
}
}?>
</div>
</div>
</div>
</li>
</ul>
</fieldset>
</li>
<li class="formItem">
<span class="buttonFieldGroup" >
<input type="submit" value="Join Moonshine Network" class="formButton Sidebar" id="Insert" name="Insert" />
</span>
</li>
</ul>
</form></div>
<div id="Insert_Sidebar_Default_ProgressMessageWrapper" class="blockUIOverlay" style="display:none;">
<script type="text/javascript">
WADFP_SetProgressToForm('Insert_Sidebar_Default', 'Insert_Sidebar_Default_ProgressMessageWrapper', WADFP_Theme_Options['SmallSpin:Slate']);
</script>
<div id="Insert_Sidebar_Default_ProgressMessage" >
<p style="margin:10px; padding:5px;" ><img src="webassist/progress_bar/images/slate-smallspin.gif" alt="" title="" style="vertical-align:middle;" />&nbsp;&nbsp;Please wait</p>
</div>
</div>


<script src="webassist/forms/wa_servervalidation.js" type="text/javascript"></script>
<script src="webassist/jq_validation/jquery.h5validate.js"></script>
<script>
var Insert_Sidebar_Default_Opts = {
focusout: true,
focusin: false,
change: false,
keyup: false,
popupClass: "Bloom",
pointedAt: "left",
fieldOffset: 10,
fieldMargin: 2,
position: "left",
direction: "left",
border: 1,
offset: 25,
closeText: "?",
percentWidth: 100,
orientation: "bottom"
};
function Insert_Sidebar_Default_Validate() {
$("#Insert_Sidebar_Default").h5Validate(Insert_Sidebar_Default_Opts);
}
$(document).ready(function () {
Insert_Sidebar_Default_Validate()
ConvertServerErrors(Insert_Sidebar_Default_Opts);
});
</script>
<div class="clear"></div>
<p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p>
<!-- end main --></div>
<!-- end #wrapper --></div>
<div class="clear"></div>
<div class="footer100">
<div id="footer">
<?php require_once('includes/footer.php'); ?>
<!-- end #footer --></div>
<!-- end #footer100 --></div>
<!-- end #wrapper100 --></div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script src="js/superfish.js"></script>
<script type="text/javascript" src="js/myscript.js"></script>
</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...