Home Forums Porto Template recaptcha v3 SyntaxError: JSON.parse

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #10031373
    girancsi
    Participant

    Dear Okler,

    I tried to implement reCAPTCHA V3 unsuccessfully.

    the falowing error occured:
    SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data

    Thank you for your help
    Best regards



    Template Version: 7.6.0
    #10031381
    Support2
    Keymaster

    Hello, thanks for your purchase.

    In your provided website link I saw that’s missing a lot of JS scripts that’s needed to get recaptcha v3 working.

    My suggestion for you is use this page as start for your project: http://preview.oklerthemes.com/porto/7.6.0/contact-us-recaptcha.html (contact-us-recaptcha.html)

    Make sure you already generated a Google Recaptcha v3 account, has configured/linked the website domain on account and has the API keys in your hands. Then search by YOUR_RECAPTCHA_SITE_KEY and replace with your Google Recaptcha v3 site key. Also replace the keys on the PHP file php/contact-form-recaptcha-v3.php.

    Another way is follow the instructions in our Documentation (the documentation comes with the template in the downloaded .zip package). Look for “Google Recaptcha V3” on the left sidebar.

    Please try that and let us know if you need further assistance.

    Kind Regards,

    Rodrigo.


    #10031404
    girancsi
    Participant

    Thank you for your help Rodrigo!
    I followed the instructions in your Documentation.
    And I think im realy close now

    When I press the Send Message button –> Loading… and nothing happens

    I have included the falowing js in index.html: (as dexcribed in the Documentation)
    jquery.validate.min.js
    view.contact.js
    theme.js (in the documentation it isn’t mentioned about this but i found some recaptcha validation js script in it… so i included)
    – recaptcha site key

    I modified contact-form-recaptcha-v3 php
    – secret key
    – email adress variable

    Best regards, Janos


    #10031411
    Support2
    Keymaster

    Hello,

    Great!

    Probably this is being caused because you are using the slim version of jquery. Try using the full version (that supports $.ajax).

    Please try that and let us know if you need further assistance.

    Kind Regards,

    Rodrigo.


    #10031419
    girancsi
    Participant

    Helo
    You had right
    I changed to non slim version of jquery and started to work

    But I got the fallowing error:

    [03-Dec-2019 18:43:49 Europe/London] PHP Warning: require(php-mailer/src/PHPMailer.php): failed to open stream: No such file or directory in /home/glsystec/public_html/mindenamilakas.hu/php/contact-form-recaptcha-v3.php on line 20
    [03-Dec-2019 18:43:49 Europe/London] PHP Fatal error: require(): Failed opening required ‘php-mailer/src/PHPMailer.php’ (include_path=’.:/opt/alt/php72/usr/share/pear’) in /home/glsystec/public_html/mindenamilakas.hu/php/contact-form-recaptcha-v3.php on line 20

    Thanks


    #10031423
    Support2
    Keymaster

    Hello,

    Great!

    Now it’s missing you send/upload to server the folder /php/***. Inside this folder it’s the PHP Mailer script (that’s the file mentioned on errors)

    Please try that and let us know if you need further assistance.

    Kind Regards,

    Rodrigo.


    #10031430
    girancsi
    Participant

    Hello Rodrigo,

    Better!

    I uploaded the missing php-mailer folder in my php folder
    I set debug variable to 2:
    // If the e-mail is not working, change the debug option to 2 | $debug = 2;
    $debug = 2;
    But I still get only this message without debud informations:
    “Error! There was an error sending your message.”
    What should I do?
    Best Regards, John


    #10031435
    Support2
    Keymaster

    Hello,

    This mean that your contact probably it’s working and sending the message.

    You are receiving the emails in your inbox (the email defined on variable $email) ?

    If you are receiving the emails, just change the debug variable to $debug = 0.

    If you are not receiving the emails, please share all code of your contact-form-recaptcha-v3.php with us. You can use a service like https://pastebin.com to generate a link with your code.

    Kind Regards,

    Rodrigo.


    #10031439
    girancsi
    Participant

    Hello.

    Thank you much for your help!
    $debug = 0 (the error message it was confusing…)
    It’s woking perfectly
    Have a nice day!


    #10031441
    Support2
    Keymaster

    Hello,

    Great!

    If you need further assistance, feel free to contact us.

    Kind Regards,

    Rodrigo.


Viewing 10 posts - 1 through 10 (of 10 total)