close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

reCAPTCHA with Universal Email 4

Thread began 12/03/2010 8:02 am by lwade-bahr409715 | Last modified 12/27/2010 10:13 am by Ray Borduin | 11809 views | 42 replies |

lwade-bahr409715

reCAPTCHA with Universal Email 4

I have created a form and am trying to use reCAPTCHA with UE4. When the form is submitted, the page displayed is the verify.php page from reCAPTCHA not the ThankYou.htm page I have specified in UE4. It is also not processing the email. -- Have you seen this before and can you please offer advice on a fix? Thank you!

Sign in to reply to this post

Jason ByrnesWebAssist

all of the form processing code must be on the forms action page.


if the forms action is set to post to the verify.php page, the universal email will need to be on that page as well.

Sign in to reply to this post

lwade-bahr409715

Thanks for the quick reply. I added the code to the Verify.php file and the behavior is the same.

Sign in to reply to this post

Jason ByrnesWebAssist

what trigger did you use? Make sure not to use the Currant page submit trigger.

to be honest, I've never used recaptcha so i cannot saw whether it will work or not.

Sign in to reply to this post

lwade-bahr409715

I did use the submit trigger. What trigger should I use instead? (reCAPTCHA is what is being used in this forum).

Sign in to reply to this post

Jason ByrnesWebAssist

use the any form post trigger



This form may use reCapcha, but it was created by vBulletin, not WebAssist.


I am not familiar with the work flow of applying recaptcha, that is why i cannot say if it will work or not.

I _can_ say that universal Email will work with the captcha that is available as part pf form toolkit though.

Sign in to reply to this post

lwade-bahr409715

Can you tell me how to change the trigger in the code? (Sorry, but I am new to PHP) I would like to try that before changing. Form Toolkit was not part of the Super Suite purchase and I would prefer to not spend the money at this point if possible.

Sign in to reply to this post

Jason ByrnesWebAssist

send me a copy of the page and I will tell you what needs to be changed.

Sign in to reply to this post

lwade-bahr409715

Thanks so much! I have zipped the contact form and verify.php file. As I mentioned, I did not originally have the code in the verify.php file until you said I should add it.

I appreciate your help!

Attached Files
Contact_Us-Verify.zip
Sign in to reply to this post

Jason ByrnesWebAssist

OK, so the code in the verify page that performs the recaptcha is this:

php:
<?php   

require_once('recaptchalib.php');   
$privatekey "6LfkSb8SAAAAAFTdEqxOh88xq0KGh2xovD9nq1mA"
$resp recaptcha_check_answer ($privatekey,
                                 
$_SERVER["REMOTE_ADDR"],
                                 
$_POST["recaptcha_challenge_field"],
                                 
$_POST["recaptcha_response_field"]);    
if (!
$resp->is_valid) {    
    
// What happens when the CAPTCHA was entered incorrectly
    
die ("The reCAPTCHA wasn't entered correctly. Go back and try it again." .          "(reCAPTCHA said: " $resp->error ")");
   } else {   
     
$GoToPage "ThankYou.htm";  
   }   
     
?>




the universal email code needs to replace the the:
$GoToPage = "ThankYou.htm";
so the full code for the verify page should be:

php:
<?php require_once("webassist/email/mail_php.php"); ?>

<?php 
require_once("webassist/email/mailformatting_php.php"); ?>
<?php
if (!isset($_SESSION))session_start();
?>
<?php   
require_once('recaptchalib.php');   
$privatekey "6LfkSb8SAAAAAFTdEqxOh88xq0KGh2xovD9nq1mA"
$resp recaptcha_check_answer ($privatekey,
                                 
$_SERVER["REMOTE_ADDR"],
                                 
$_POST["recaptcha_challenge_field"],
                                 
$_POST["recaptcha_response_field"]);    
if (!
$resp->is_valid) {    
    
// What happens when the CAPTCHA was entered incorrectly
    
die ("The reCAPTCHA wasn't entered correctly. Go back and try it again." .          "(reCAPTCHA said: " $resp->error ")");
} else {   
      
//WA Universal Email object="mail"
  
set_time_limit(0);
  
$EmailRef "waue_Contact_Us_4";
  
$BurstSize 200;
  
$BurstTime 1;
  
$WaitTime 1;
  
$GoToPage "ThankYou.htm";
  
$RecipArray = array();
  
$StartBurst time();
  
$LoopCount 0;
  
$TotalEmails 0;
  
$RecipIndex 0;
  
// build up recipients array
  
$CurIndex sizeof($RecipArray);
  
$RecipArray[$CurIndex] = array();
  
$RecipArray[$CurIndex ][] = "contactus@imfgsol.com";
  
$RecipArray[$CurIndex ][] = "jerry.bahr@imfgsol.com";
  
$RecipArray[$CurIndex ][] = "randy.bahr@imfgsol.com";
  
$RecipArray[$CurIndex ][] = "lwade-bahr@comcast.net";
  
$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;
  }
  
$_SESSION[$EmailRef."_Total"] = $TotalEmails;
  
$_SESSION[$EmailRef."_Index"] = 0;
  
$_SESSION[$EmailRef."_Remaining"] = $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 ++;
      
session_commit();
      
session_start();
      
$_SESSION[$EmailRef."_Index"] = $LoopCount;
      
$_SESSION[$EmailRef."_Remaining"] = round($TimeRemaining);
      
session_commit();
      
wa_sleep($WaitTime);
      include(
"webassist/email/waue_Contact_Us_4.php");
      
$endtime microtime_float();
      
$TimeTracker[] =$endtime $starttime;
      
$RealWait array_sum($TimeTracker)/sizeof($TimeTracker);
      if (
$LoopCount $BurstSize == && $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[$EmailRef."_Total"] = 0;
  
$_SESSION[$EmailRef."_Index"] = 0;
  
$_SESSION[$EmailRef."_Remaining"] = 0;
  
session_commit();
  
session_start();
  if (
$GoToPage!="")     {
    
header("Location: ".$GoToPage);
  }
}   
     
?>
Sign in to reply to this post
loading

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