Jump to content

How to integrate hcaptcha into a .tpl file?


Recommended Posts

Hello, in WHMCS, I have supportticketsubmit-steptwo.tpl file, and i would like to add hcaptcha to it.

I have the hcaptcha code, which seems to be PHP.

The last line i could add into the mentioned .tpl file, after current recaptcha button code, but regarding PHP-like code, when i have added it between {php}{/php} tags, it failed to display support form.

List of hcaptcha integrations: https://github.com/hCaptcha/hcaptcha-integrations-list?tab=readme-ov-file#hcaptcha-integrations-list

Please can you tell me what to place where in order it to display recaptcha + hcaptcha?

Edited by postcd
Link to comment
Share on other sites

7 hours ago, bear said:

Have you specifically allowed {php} tags in smarty? I believe it's off by default.

No, but when i insert into said .tpl file:

Quote

{php}
echo "smarty PHP4";
phpinfo();
{/php}

then it shows a PHP info page and the text...

Link to comment
Share on other sites

  • 2 weeks later...
On 6/10/2024 at 9:30 PM, postcd said:

Hello, in WHMCS, I have supportticketsubmit-steptwo.tpl file, and i would like to add hcaptcha to it.

I have the hcaptcha code, which seems to be PHP.

The last line i could add into the mentioned .tpl file, after current recaptcha button code, but regarding PHP-like code, when i have added it between {php}{/php} tags, it failed to display support form.

List of hcaptcha integrations: https://github.com/hCaptcha/hcaptcha-integrations-list?tab=readme-ov-file#hcaptcha-integrations-list

Please can you tell me what to place where in order it to display recaptcha + hcaptcha?

I been trying for days to allow {php} tags in my .tpl no matter what smarty policy i do it won't work

can you please guide me how to do so?

Thanks

Link to comment
Share on other sites

Posted (edited)
On 6/23/2024 at 8:03 AM, WhmTools said:

ask the support of hcaptcha

I have asked them and their reply is to use minimal example: https://docs.hcaptcha.com/#add-the-hcaptcha-widget-to-your-webpage

Quote
<html>
  <head>
    <title>hCaptcha Demo</title>
    <script src="https://js.hcaptcha.com/1/api.js" async defer></script>
  </head>
  <body>
    <form action="" method="POST">
      <input type="text" name="email" placeholder="Email" />
      <input type="password" name="password" placeholder="Password" />
      <div class="h-captcha" data-sitekey="your_site_key"></div>
      <br />
      <input type="submit" value="Submit" />
    </form>
  </body>
</html>

 

and to call "siteverify" using the token returned from answering the challenge. Pseudo-code example for that: https://docs.hcaptcha.com/#verify-the-user-response-server-side .

They are also linking to https://docs.hcaptcha.com and https://github.com/hCaptcha/hcaptcha-integrations-list ...

Edited by postcd
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated