Page 17 of 19 FirstFirst ... 71516171819 LastLast
Results 161 to 170 of 188
  1. #161
    Join Date
    Jun 2009
    Posts
    83
    Plugin Contributions
    4

    Default Re: Adding reCAPTCHA to Contact Us Form

    This seems to be common error that pops up if you may have previously used another captcha before. I wrapped the code in a function_exists() block. So if the function has already been declared it won't try again.

    CP go ahead and enable the reCaptcha for the Contact page, and it should work for you now.

  2. #162
    Join Date
    Aug 2008
    Posts
    25
    Plugin Contributions
    0

    Default Re: Adding reCAPTCHA to Contact Us Form

    Sorry for not completely understand but I turned "contact us form" in Configuration/ReCaptcha Options/ from true to false the turned it back to true. So to the "Enable Create Account Form". However it still doesn't work. When I input any word in a search box, I still get a blank page. However the error log is different now:

    [31-Mar-2012 12:46:30] PHP Fatal error: Cannot redeclare _recaptcha_http_post() (previously declared in ../includes/classes/recaptchalib.php:68) in ../includes/classes/recaptchalib.php on line 93

    What else can I do?



    CP

  3. #163
    Join Date
    Jun 2009
    Posts
    83
    Plugin Contributions
    4

    Default Re: Adding reCAPTCHA to Contact Us Form

    In that file you need to put the function_exists around that line as well. So in includes/classes/recaptchalib.php, change around line 63 to:
    Code:
    if ( !function_exists('_recaptcha_http_post') )
    {
      /**
     * Submits an HTTP POST to a reCAPTCHA server
     * @param string $host
     * @param string $path
     * @param array $data
     * @param int port
     * @return array response
     */
       function _recaptcha_http_post($host, $path, $data, $port = 80)
       {
    
            $req = _recaptcha_qsencode ($data);
    
            $http_request  = "POST $path HTTP/1.0\r\n";
            $http_request .= "Host: $host\r\n";
            $http_request .= "Content-Type: application/x-www-form-urlencoded;\r\n";
            $http_request .= "Content-Length: " . strlen($req) . "\r\n";
            $http_request .= "User-Agent: reCAPTCHA/PHP\r\n";
            $http_request .= "\r\n";
            $http_request .= $req;
    
            $response = '';
            if( false == ( $fs = @fsockopen($host, $port, $errno, $errstr, 10) ) ) {
                    die ('Could not open socket');
            }
    
            fwrite($fs, $http_request);
    
            while ( !feof($fs) )
                    $response .= fgets($fs, 1160); // One TCP-IP packet
            fclose($fs);
            $response = explode("\r\n\r\n", $response, 2);
    
            return $response;
       }
    }

  4. #164
    Join Date
    Aug 2008
    Posts
    25
    Plugin Contributions
    0

    Default Re: Adding reCAPTCHA to Contact Us Form

    Hello Pickupman

    I copied the above code and replaced the section on the /inludes/classes/recaptchlib.php but the problem is the same the error code:


    [31-Mar-2012 14:04:08] PHP Fatal error: Cannot redeclare _recaptcha_qsencode() (previously declared in ../includes/classes/recaptchalib.php:47) in ../includes/classes/recaptchalib.php on line 55

    I pull my hairs off.



    CP

  5. #165
    Join Date
    Jun 2009
    Posts
    83
    Plugin Contributions
    4

    Default Re: Adding reCAPTCHA to Contact Us Form

    I have updated your file for you. Try enabling it now and see what happens.

  6. #166
    Join Date
    Aug 2008
    Posts
    25
    Plugin Contributions
    0

    Default Re: Adding reCAPTCHA to Contact Us Form

    Hello pickupman

    Appreciate your help. I get the new error code now:


    [01-Apr-2012 00:06:36] PHP Fatal error: Cannot redeclare recaptcha_check_answer() (previously declared in ../includes/classes/recaptchalib.php:156) in ../includes/classes/recaptchalib.php on line 197



    CP

  7. #167
    Join Date
    Jun 2009
    Posts
    83
    Plugin Contributions
    4

    Default Re: Adding reCAPTCHA to Contact Us Form

    Hello CP_River,
    Not sure why this code is getting loaded twice, but anyways I have wrapped all of those functions for you to prevent those errors from appearing. I have re uploaded the file to your site for you.

    I can see the reCaptcha on the contact us page on your site.

  8. #168
    Join Date
    Aug 2008
    Posts
    25
    Plugin Contributions
    0

    Default Re: Adding reCAPTCHA to Contact Us Form

    Hello Pickupman

    I feel sorry to spend lots of your time on this. However the site "search" still not work. I believe the reCaptcha seems ok and it appeared on contact us page etc, but just that if I do any site search, the blank page appeared, the the error logs indicate that something to do with the ReCaptcha. This time the error code as bellow:

    [02-Apr-2012 02:00:57] PHP Fatal error: Cannot redeclare class ReCaptchaResponse in ../includes/classes/recaptchalib.php on line 141

    Also these is another log file:

    installerConfigKeys|a:1:{s:8:"language";s:7:"english";}logfilename|s:27:"Jan-16-2012_09-40-58-o64i2Q";installerConfigInfo|a:0:{}


    Cheers

    CP

  9. #169
    Join Date
    Jun 2009
    Posts
    83
    Plugin Contributions
    4

    Default Re: Adding reCAPTCHA to Contact Us Form

    CP,
    I got the problem figured out for you finally. You can't have more than one header_php file in the /includes/modules/pages folders. It looks like you were renaming backups. However, zencart runs each of those files. So it was executing the header_php files multiple times creating the redeclare errors. I have removed those file from the folders, and now it is running properly.

    If you want to have a backup just do not use header_php in the file name.

    Running WinCacheGrind, I could see zencart loading:
    index.php
    --->require: application_top.php
    --->require: header_php.php
    --->require: header_php_original.php

  10. #170
    Join Date
    Aug 2008
    Posts
    25
    Plugin Contributions
    0

    Default Re: Adding reCAPTCHA to Contact Us Form

    Hello Pickupman

    That works perfectly now. Thank you very much again for your effort, patience and time.

    Cheers

    CP

 

 
Page 17 of 19 FirstFirst ... 71516171819 LastLast

Similar Threads

  1. Contact reCAPTCHA
    By nolsowski in forum All Other Contributions/Addons
    Replies: 5
    Last Post: 29 Apr 2012, 08:54 PM
  2. Contact Recaptcha
    By Miff in forum General Questions
    Replies: 1
    Last Post: 15 Jun 2011, 10:40 PM
  3. Adding a contact form
    By Matt Smith in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 8 Jun 2010, 11:27 PM
  4. Using two modules add extra fields and recaptcha to contact form
    By webmiss in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 22 Feb 2010, 07:43 PM
  5. Removing default contact info on contact us page/adding form to page
    By haggis0929 in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 28 Dec 2009, 06:41 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg