I just finished up my third hour trying to figure this out, and I’m
back to square one.
I have this form that I use with Forms To Go:
http://bbrc.net/Signups/annivdinner/
I swear I tested it when I created it, the same way I test all my
forms, and it was working exactly right. Now, a couple of weeks later,
it’s not recognizing any of the validation, and you can click submit
and it is processed with no info. It ignores the email validation and
the spam protection field and the name field, all of which require
validation, when it should give an error page with messages as to what
is wrong and telling you to go back and fill in these fields or delete
the text in the spam field. I didn’t even know it wasn’t working
properly till someone told me today. The form itself is working, and
we are getting input, but they shouldn’t be able to just click the
submit button and be taken to the confirmation page without filling in
the required information. Yet, that it what is happening.
I have checked the FreewayTalk lists and the Bebosoft forums. I have
added the FormFix action, and when that didn’t make a difference, I
went in and manually added the type=text. No difference. I checked my
FTG file against other forms that are working fine. I even created a
new FTG file and exported a new PHP script.
I tried different things that I read about inline html boxes, not a
child, etc., and I finally recreated the page. Absolutely nothing I
have done has fixed this. I’ve been using FTG for a year now and have
made many forms. In fact, I have three more forms on this website, all
using FTG scripts, all made in Freeway Pro 5. They are working fine:
http://bbrc.net/payments.html
http://bbrc.net/makeupform.html
http://bbrc.net/roar.html
Please, someone help me! I will give you my first born male child.
Okay, he is 16 now and you probably don’t want him, but surely you
feel my pain!!
I am going to paste my PHP script below, in case it means anything:
<?PHP
######################################################
# #
# Forms To Go 4.0.3 #
# http://www.bebosoft.com/ #
# #
######################################################
define('kOptional', true);
define('kMandatory', false);
define('kStringRangeFrom', 1);
define('kStringRangeTo', 2);
define('kStringRangeBetween', 3);
define('kYes', 'yes');
define('kNo', 'no');
define('kTextDumpFieldSeparator', 'tab');
error_reporting(E_ERROR | E_WARNING | E_PARSE);
ini_set('track_errors', true);
function DoStripSlashes($fieldValue) {
if ( get_magic_quotes_gpc() ) {
if (is_array($fieldValue) ) {
return array_map('DoStripSlashes', $fieldValue);
} else {
return stripslashes($fieldValue);
}
} else {
return $fieldValue;
}
}
function FilterCChars($theString) {
return preg_replace('/[x00-x1F]/', '', $theString);
}
function ProcessTABCVSField($theString, $textSeparator) {
if ($textSeparator == 'tab') {
$theString = preg_replace('/t/', ' ', $theString);
}
$theString = preg_replace('/"/', '""', $theString);
return $theString;
}
function ProcessPHPFile($PHPFile) {
ob_start();
require $PHPFile;
return ob_get_clean();
}
function CheckString($value, $low, $high, $mode, $limitAlpha,
$limitNumbers, $limitEmptySpaces, $limitExtraChars, $optional) {
if ($limitAlpha == kYes) {
$regExp = 'A-Za-z';
}
if ($limitNumbers == kYes) {
$regExp .= '0-9';
}
if ($limitEmptySpaces == kYes) {
$regExp .= ' ';
}
if (strlen($limitExtraChars) > 0) {
$search = array('', '[', ']', '-', '$', '.', '*', '(', ')', '?',
'+', '^', '{', '}', '|');
$replace = array('', '[', ']', '-', '$', '.', '*', '(',
')', '?', '+', '^', '{', '}', '|');
$regExp .= str_replace($search, $replace, $limitExtraChars);
}
if ( (strlen($regExp) > 0) && (strlen($value) > 0) ){
if (preg_match('/[^' . $regExp . ']/', $value)) {
return false;
}
}
if ( (strlen($value) == 0) && ($optional === kOptional) ) {
return true;
} elseif ( (strlen($value) >= $low) && ($mode == kStringRangeFrom) ) {
return true;
} elseif ( (strlen($value) <= $high) && ($mode == kStringRangeTo) ) {
return true;
} elseif ( (strlen($value) >= $low) && (strlen($value) <= $high) &&
($mode == kStringRangeBetween) ) {
return true;
} else {
return false;
}
}
function CheckEmail($email, $optional) {
if ( (strlen($email) == 0) && ($optional === kOptional) ) {
return true;
} elseif ( eregi("^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]
+)*(.[a-z]{2,4})$", $email) ) {
return true;
} else {
return false;
}
}
if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$clientIP = $_SERVER['HTTP_X_FORWARDED_FOR'];
} else {
$clientIP = $_SERVER['REMOTE_ADDR'];
}
$FTGmembername = DoStripSlashes( $_REQUEST['membername'] );
$FTGemail = DoStripSlashes( $_REQUEST['email'] );
$FTGmemberbeef = DoStripSlashes( $_REQUEST['memberbeef'] );
$FTGmemberhalibut = DoStripSlashes( $_REQUEST['memberhalibut'] );
$FTGmemberveg = DoStripSlashes( $_REQUEST['memberveg'] );
$FTGguestname1 = DoStripSlashes( $_REQUEST['guestname1'] );
$FTGguest1beef = DoStripSlashes( $_REQUEST['guest1beef'] );
$FTGguest1halibut = DoStripSlashes( $_REQUEST['guest1halibut'] );
$FTGguest1veg = DoStripSlashes( $_REQUEST['guest1veg'] );
$FTGguestname2 = DoStripSlashes( $_REQUEST['guestname2'] );
$FTGguest2beef = DoStripSlashes( $_REQUEST['guest2beef'] );
$FTGguest2halibut = DoStripSlashes( $_REQUEST['guest2halibut'] );
$FTGguest2veg = DoStripSlashes( $_REQUEST['guest2veg'] );
$FTGguestname3 = DoStripSlashes( $_REQUEST['guestname3'] );
$FTGguest3beef = DoStripSlashes( $_REQUEST['guest3beef'] );
$FTGguest3halibut = DoStripSlashes( $_REQUEST['guest3halibut'] );
$FTGguest3veg = DoStripSlashes( $_REQUEST['guest3veg'] );
$FTGtotal = DoStripSlashes( $_REQUEST['total'] );
$FTGonline = DoStripSlashes( $_REQUEST['online'] );
$FTGcheck = DoStripSlashes( $_REQUEST['check'] );
$FTGspam = DoStripSlashes( $_REQUEST['spam'] );
$FTGSubmit = DoStripSlashes( $_REQUEST['Submit'] );
# Fields Validations
$validationFailed = false;
if (!CheckString($FTGmembername, 2, 80, kStringRangeBetween, kNo, kNo,
kNo, '', kMandatory)) { $validationFailed = true; }
if (!CheckEmail($FTGemail, kMandatory)) { $validationFailed = true; }
if (!CheckString($FTGtotal, 1, 1, kStringRangeBetween, kNo, kNo, kNo,
'', kMandatory)) { $validationFailed = true; }
if (!CheckString($FTGspam, 0, 0, kStringRangeBetween, kNo, kNo, kNo,
'', kMandatory)) { $validationFailed = true; }
# Redirect user to the error page
if ($validationFailed === true) {
header("Location: http://www.bbrc.net/Signups/annivdinner/paymentthanks.html
");
exit;
}
# Email to Form Owner
$emailSubject = FilterCChars("RSVP Anniversary Dinner");
$emailBody = "MEMBER : $FTGmembernamen"
. "EMAIL : $FTGemailn"
. "MEAL CHOICE : $FTGmemberbeef $FTGmemberhalibut $FTGmembervegn"
. "n"
. "----------n"
. "n"
. "GUEST #1 : $FTGguestname1n"
. "MEAL CHOICE : $FTGguest1beef $FTGguest1halibut $FTGguest1vegn"
. "n"
. "GUEST #2 : $FTGguestname2n"
. "MEAL CHOICE : $FTGguest2beef $FTGguest2halibut $FTGguest2vegn"
. "n"
. "GUEST #3 : $FTGguestname3n"
. "MEAL CHOICE : $FTGguest3beef $FTGguest3halibut $FTGguest3vegn"
. "n"
. "----------n"
. "n"
. "TOTAL IN PARTY : $FTGtotaln"
. "n"
. "----------n"
. "n"
. "PAYMENT METHOD : $FTGonline $FTGcheckn"
. "";
$emailTo = 'Anniversary Dinner ';
$emailFrom = FilterCChars("$FTGemail");
$emailHeader = "From: $emailFromn"
. "MIME-Version: 1.0n"
. "Content-type: text/plain; charset="ISO-8859-1"n"
. "Content-transfer-encoding: 7bitn";
mail($emailTo, $emailSubject, $emailBody, $emailHeader);
# Confirmation Email to User
$confEmailTo = FilterCChars($FTGemail);
$confEmailSubject = FilterCChars("Anniversary Dinner RSVP Received");
$confEmailBody = "Thank you for signing up for the 23rd Annual BBRC
Anniversary Dinner. The information you submitted is shown below.n"
. "n"
. "If you made your payment online through PayPal, you will also
receive a confirmation email from PayPal with the details of your
online payment transaction. n"
. "n"
. "If you elected to pay by check, be sure to give your check to
Sayoko Kuwahara by the deadline of November 3. n"
. "n"
. "REMEMBER: YOUR RESERVATION FOR THIS EVENT IS NOT CONFIRMED UNTIL
YOUR PAYMENT HAS BEEN RECEIVED, WHETHER IT'S AN ONLINE PAYMENT OR A
CHECK!n"
. "n"
. "More information and directions to the event are available on the
sign-up page: http://bbrc.net/Signups/annivdinner/n"
. "n"
. "Questions? Contact email@hidden"
. "n"
. "n"
. "----------n"
. "n"
. "MEMBER : $FTGmembernamen"
. "EMAIL : $FTGemailn"
. "MEAL CHOICE : $FTGmemberbeef $FTGmemberhalibut $FTGmembervegn"
. "n"
. "----------n"
. "n"
. "GUEST #1 : $FTGguestname1n"
. "MEAL CHOICE : $FTGguest1beef $FTGguest1halibut $FTGguest1vegn"
. "n"
. "GUEST #2 : $FTGguestname2n"
. "MEAL CHOICE : $FTGguest2beef $FTGguest2halibut $FTGguest2vegn"
. "n"
. "GUEST #3 : $FTGguestname3n"
. "MEAL CHOICE : $FTGguest3beef $FTGguest3halibut $FTGguest3vegn"
. "n"
. "----------n"
. "n"
. "TOTAL IN PARTY : $FTGtotaln"
. "n"
. "----------n"
. "n"
. "PAYMENT METHOD : $FTGonline $FTGcheckn"
. "";
$confEmailHeader = "From: email@hidden"
. "MIME-Version: 1.0n"
. "Content-type: text/plain; charset="ISO-8859-1"n"
. "Content-transfer-encoding: 7bitn";
mail($confEmailTo, $confEmailSubject, $confEmailBody, $confEmailHeader);
#====================================================
# Dump field values to a text file =
#====================================================
$dumpRecord = sprintf("%st%st%st%st%st%st%st%st%st%st%st%st
%st%st%st%st%st%st%st%st%s",
ProcessTABCVSField($FTGmembername,
kTextDumpFieldSeparator),
ProcessTABCVSField($FTGemail, kTextDumpFieldSeparator),
ProcessTABCVSField($FTGmemberbeef,
kTextDumpFieldSeparator),
ProcessTABCVSField($FTGmemberhalibut,
kTextDumpFieldSeparator),
ProcessTABCVSField($FTGmemberveg,
kTextDumpFieldSeparator),
ProcessTABCVSField($FTGguestname1,
kTextDumpFieldSeparator),
ProcessTABCVSField($FTGguest1beef,
kTextDumpFieldSeparator),
ProcessTABCVSField($FTGguest1halibut,
kTextDumpFieldSeparator),
ProcessTABCVSField($FTGguest1veg,
kTextDumpFieldSeparator),
ProcessTABCVSField($FTGguestname2,
kTextDumpFieldSeparator),
ProcessTABCVSField($FTGguest2beef,
kTextDumpFieldSeparator),
ProcessTABCVSField($FTGguest2halibut,
kTextDumpFieldSeparator),
ProcessTABCVSField($FTGguest2veg,
kTextDumpFieldSeparator),
ProcessTABCVSField($FTGguestname3,
kTextDumpFieldSeparator),
ProcessTABCVSField($FTGguest3beef,
kTextDumpFieldSeparator),
ProcessTABCVSField($FTGguest3halibut,
kTextDumpFieldSeparator),
ProcessTABCVSField($FTGguest3veg,
kTextDumpFieldSeparator),
ProcessTABCVSField($FTGtotal, kTextDumpFieldSeparator),
ProcessTABCVSField($FTGonline, kTextDumpFieldSeparator),
ProcessTABCVSField($FTGcheck, kTextDumpFieldSeparator),
date('Y-m-d H:i:s'));
$dumpRecord = str_replace("n", "n", $dumpRecord);
$dumpRecord = str_replace("r", "r", $dumpRecord);
$dumpRecord = $dumpRecord . "n";
$fileDump = '/home/bbrcnet/public_html/Signups/annivdinner/signups.tab';
$fileHandle = @fopen($fileDump, 'a');
if ($fileHandle === false) {
echo '
Text Dump Error: Cannot write to the text file:
' .
$fileDump . '';
if (ini_get('track_errors')) {
echo '
PHP Error: ' . $php_errormsg;
}
exit;
} else {
fwrite($fileHandle, $dumpRecord);
fclose($fileHandle);
}
# Embed success page and dump it to the browser
$fileSuccessPage = '/home/bbrcnet/public_html/Signups/annivdinner/
paymentthanks.html';
if (file_exists($fileSuccessPage) === false) {
echo 'ErrorThe success page:
' . $fileSuccessPage . ' cannot be found on the server.';
exit;
}
$successPage = ProcessPHPFile($fileSuccessPage);
$successPage = str_replace('',
$FTGmembername, $successPage);
$successPage = str_replace('', $FTGemail,
$successPage);
$successPage = str_replace('',
$FTGmemberbeef, $successPage);
$successPage = str_replace('',
$FTGmemberhalibut, $successPage);
$successPage = str_replace('',
$FTGmemberveg, $successPage);
$successPage = str_replace('',
$FTGguestname1, $successPage);
$successPage = str_replace('',
$FTGguest1beef, $successPage);
$successPage = str_replace('',
$FTGguest1halibut, $successPage);
$successPage = str_replace('',
$FTGguest1veg, $successPage);
$successPage = str_replace('',
$FTGguestname2, $successPage);
$successPage = str_replace('',
$FTGguest2beef, $successPage);
$successPage = str_replace('',
$FTGguest2halibut, $successPage);
$successPage = str_replace('',
$FTGguest2veg, $successPage);
$successPage = str_replace('',
$FTGguestname3, $successPage);
$successPage = str_replace('',
$FTGguest3beef, $successPage);
$successPage = str_replace('',
$FTGguest3halibut, $successPage);
$successPage = str_replace('',
$FTGguest3veg, $successPage);
$successPage = str_replace('', $FTGtotal,
$successPage);
$successPage = str_replace('', $FTGonline,
$successPage);
$successPage = str_replace('', $FTGcheck,
$successPage);
$successPage = str_replace('', $FTGspam,
$successPage);
$successPage = str_replace('', $FTGSubmit,
$successPage);
echo $successPage;
exit;
?>
On Jun 30, 2008, at 9:13 AM, chuckamuck wrote:
Robin Stark
offtopic mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options