Kunena Menu
Captcha CK in a Joomla+Bootstrap page
- ClaudioRomeo
- Topic Author
- Offline
- Platinum Member
-
1 year 3 months ago #74821
by ClaudioRomeo
Counselor for better people in a better company
Captcha CK in a Joomla+Bootstrap page was created by ClaudioRomeo
I am using Captcha CK on a Joomla 5.3.2 + Bootstrap website.I have created a page with numerous fields to ask my customers for their billing information.I used PHP and Bootstrap, with Sourcerer (by Regular Labs). Everything works perfectly: the data is sent, the success message appears, the administrator receives the data, and the sender receives their copy (if requested).However, I am unable to integrate Captcha CK. This is not a contact form, so I used PHP to insert Captcha CK into the page:
Verification (server-side, before sending email):
I also tried the event:
The captcha appears regularly, but the verification always fails.Now I have two questions:1. Is there a way to call Captcha CK and use it on a custom page?2. Alternatively, can you define a Captcha CK module to insert as you wish?
Joomla 5.3.2, PHP 8.3.21, Captcha CK 2.0.1
Code:
\Joomla\CMS\Plugin\PluginHelper::importPlugin(“captcha”); $captcha = \Joomla\CMS\Captcha\Captcha::getInstance(“captchack”); echo $captcha->display(“captcha”, “BillingData”, “form-control”);
Code:
\Joomla\CMS\Plugin\PluginHelper::importPlugin(“captcha”); $captcha = \Joomla\CMS\Captcha\Captcha::getInstance(“captchack”); if (!$captcha->checkAnswer(null)) { // error }
Code:
$results = \Joomla\CMS\Factory::getApplication()->triggerEvent(“onCheckAnswer”, [“BillingData”]);
Joomla 5.3.2, PHP 8.3.21, Captcha CK 2.0.1
Counselor for better people in a better company
Please Log in or Create an account to join the conversation.
1 year 3 months ago #74822
by ced1870
Joomlack Webmaster and Developer
Replied by ced1870 on topic Captcha CK in a Joomla+Bootstrap page
Hi
this is not related to Captcha CK, this is related on how to integrate a captcha validation in a form with Joomla
You can check in my code how I do it in the contact form for Page Builder CK :
www.dropbox.com/scl/fi/jnq8iwvn5d725n3gs...url1p6sof089c2i&dl=0
contact2.php >> line 260 the lines used to load the captcha in the form
contact2helper.php >> line 48 the lines used to make the verification for the form submission
CEd
this is not related to Captcha CK, this is related on how to integrate a captcha validation in a form with Joomla
You can check in my code how I do it in the contact form for Page Builder CK :
www.dropbox.com/scl/fi/jnq8iwvn5d725n3gs...url1p6sof089c2i&dl=0
contact2.php >> line 260 the lines used to load the captcha in the form
contact2helper.php >> line 48 the lines used to make the verification for the form submission
CEd
Joomlack Webmaster and Developer
Please Log in or Create an account to join the conversation.
- ClaudioRomeo
- Topic Author
- Offline
- Platinum Member
-
1 year 3 months ago #74823
by ClaudioRomeo
Counselor for better people in a better company
Replied by ClaudioRomeo on topic Captcha CK in a Joomla+Bootstrap page
Thank you so much!
Counselor for better people in a better company
Please Log in or Create an account to join the conversation.
Time to create page: 0.191 seconds





