close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Contact form Solution Kit

Thread began 12/09/2010 10:00 am by mike273103 | Last modified 12/09/2010 11:06 am by Jason Byrnes | 1433 views | 1 replies |

mike273103

Contact form Solution Kit

Hi, I recently purchased Contact form Solution Kit and I have tried to follow your PDF file on inserting security and Captcha in to existing PHP forms. However the code you show in your pdf file and the code you say to cut and paste from the contactus.php that comes with the download do not match e.g page 3 copying CAPTCHA para 5:

Place your cursor between $WAFV_Errors = ""; and if ($WAFV_Errors != "")

You state that this was copied and pasted at an earlier stage, it was not the following is missing $WAFV_Errors = ""; it is not there in the code and is not present in your contactus.php form.

I have tried following your pdf but I can't get it to work.
I have php forms that do work and they are all within WA Siteassist websites but they do not have the CAPTCHA feature. Any assistance you can give would help.

If you would like me to send you one of my PHP forms I would be happy to email it to you.

Kind regards
MIke

Sign in to reply to this post

Jason ByrnesWebAssist

to copy captcha to an existing form, copy the following code at lines 2 - 26 from the contact us page:

php:
<?php require_once("WA_ValidationToolkit/WAVT_Scripts_PHP.php"); ?>

<?php 
require_once("WA_ValidationToolkit/WAVT_ValidatedForm_PHP.php"); ?>
<?php 
require_once("WA_Universal_Email/mail_PHP.php"); ?>
<?php 
require_once("WA_Universal_Email/MailFormatting_PHP.php"); ?>
<?php 
if ($_SERVER["REQUEST_METHOD"] == "POST")  {
  
$WAFV_Redirect "";
  
$_SESSION['WAVT_contact_Errors'] = "";
  if (
$WAFV_Redirect == "")  {
    
$WAFV_Redirect $_SERVER["PHP_SELF"];
  }
  
$WAFV_Errors "";
  
$WAFV_Errors .= WAValidateRQ(((isset($_POST["Contact_Name"]))?$_POST["Contact_Name"]:"") . "",true,1);
  
$WAFV_Errors .= WAValidateEM(((isset($_POST["Email_address"]))?$_POST["Email_address"]:"") . "",true,2);
  
$WAFV_Errors .= WAValidateRQ(((isset($_POST["Comments"]))?$_POST["Comments"]:"") . "",true,3);
  
$WAFV_Errors .= WAValidateLE(((isset($_POST["Security_code"]))?strtolower($_POST["Security_code"]):"") . "",((isset($_SESSION["captcha_1"]))?strtolower($_SESSION["captcha_1"]):"") . "",true,4);
  
$WAFV_Errors .= WAValidateLE(((isset($_POST["Security_question"]))?strtolower($_POST["Security_question"]):"") . "",((isset($_SESSION["random_answer"]))?strtolower($_SESSION["random_answer"]):"") . "",true,5);
  
$WAFV_Errors .= WAValidateRX(((isset($_POST["addblock"]))?$_POST["addblock"]:"") . "","/^$/i",false,6);
  
$WAFV_Errors .= WAValidateRX(((isset($_POST["seconddblock"]))?$_POST["seconddblock"]:"") . "","/^$/i",false,7);

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




Pate it to your page at line 1, then delete the following sections:

php:
<?php require_once("WA_Universal_Email/mail_PHP.php"); ?>

<?php 
require_once("WA_Universal_Email/MailFormatting_PHP.php"); ?>




php:
$WAFV_Errors .= WAValidateRQ(((isset($_POST["Contact_Name"]))?$_POST["Contact_Name"]:"") . "",true,1);

  $WAFV_Errors .= WAValidateEM(((isset($_POST["Email_address"]))?$_POST["Email_address"]:"") . "",true,2);
  $WAFV_Errors .= WAValidateRQ(((isset($_POST["Comments"]))?$_POST["Comments"]:"") . "",true,3);



php:
$WAFV_Errors .= WAValidateLE(((isset($_POST["Security_question"]))?strtolower($_POST["Security_question"]):"") . "",((isset($_SESSION["random_answer"]))?strtolower($_SESSION["random_answer"]):"") . "",true,5);

  $WAFV_Errors .= WAValidateRX(((isset($_POST["addblock"]))?$_POST["addblock"]:"") . "","/^$/i",false,6);
  $WAFV_Errors .= WAValidateRX(((isset($_POST["seconddblock"]))?$_POST["seconddblock"]:"") . "","/^$/i",false,7);



then copy line 112 - 129 to your form:

php:
<label for="Security_code" ><br />

    Security code:</label>
    <br />
    <img  src="WA_ValidationToolkit/WAVT_CaptchaSecurityImages.php?noisecolor=<?php echo $WAGLOBAL_Captcha_Noise?>&bgcolor=<?php echo $WAGLOBAL_Captcha_BG?>&textcolor=<?php echo $WAGLOBAL_Captcha_Text?>&transparent=<?php echo $WAGLOBAL_Captcha_BG_transparent?>&characters=<?php echo $WAGLOBAL_Captcha_Characters?>&width=<?php echo $WAGLOBAL_Captcha_Width?>&height=<?php echo $WAGLOBAL_Captcha_Height?>&font=<?php echo $WAGLOBAL_Captcha_Font?>" alt="security code" /><br  />
    <span id="sprytextfield3">
    <input name="Security_code" type="text" class="inputValue" id="Security_code" onblur="if (document.getElementById('captchaServerError')) document.getElementById('captchaServerError').style.display='none'" maxlength="40" />
    <span class="textfieldRequiredMsg">A value is required.</span><span class="textfieldMinCharsMsg">Minimum number of characters not met.</span><span class="textfieldMaxCharsMsg">Exceeded maximum number of characters.</span></span>
    <?php
if (ValidatedField("contact","contact"))  {
  if ((
strpos((",".ValidatedField("contact","contact").","), "," "4" ",") !== false || "4" == ""))  {
    if (!(
false))  {
?>
    <span id="captchaServerError" class="textfieldServerError">Your security code entry did not match the image.</span>
    <?php //WAFV_Conditional contact.php contact(4:)
    
}
  }
}
?>
    <br />
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...