Maths Captcha

Add maths to new file - Maths Captcha

Add maths to new file

by amaische » Thu Mar 26, 2026 9:57 am

Hello,
I have installed the maths captcha and it works in Contact_us and create_account. Now I want to add it to a new file. There is like the contact_us one file in catalog and one file in /templates/.../pages.Therefore I changed in addMaths.php

Code: Select all

    $good_pages = ['create_account.php', 'contact_us.php'];
to

Code: Select all

 $good_pages = ['create_account.php', 'contact_us.php','widerruf.php'];
Now I guess I have to insert the listen_injectFormDisplay and listen_injectFormVerify to my new files. But how and where ? I added

Code: Select all

$hooks->cat('injectFormDisplay'); 
to the file in /templates.../pages and

Code: Select all

$hooks->cat('injectFormVerify'); 
to the file in catalog.

The maths is not shown and if i submit the form, the follwing error appears "Notice: Undefined index: protect in /homepages/.../htdocs/s5/catalog/includes/hooks/shop/siteWide/addMaths.php on line 25"

What do I have to do ?
Anke

php: 7.4.33, phoenix: 1.0.9.7
amaische
Member
Posts: 13
Joined: Wed Aug 18, 2021 7:10 am
Phoenix Version: v1.0.9.7
Contact:

Re: Add maths to new file

by burt » Thu Mar 26, 2026 4:49 pm

This error means you have placed Verify correctly.
You say that the Display is not showing. This would cause the exact error you see.

You need that Display to show in your Page, you have likely misplaced it.
It can be anywhere inside the

Code: Select all

<form>
on widerruf.php
I am not here to build for you.
I am here to build with you. Let's help each other.
User avatar
burt
Core Team
Posts: 4547
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Contact:

Re: Add maths to new file

by amaische » Fri Mar 27, 2026 8:17 am

Dear Burt,
thanks for your reply. The display is between

Code: Select all

<?= new Form('widerruf', $Linker->build('widerruf.php', ['action' => 'send']), 'post', [], true) ?>
and

Code: Select all

</form>
.
Anke
amaische
Member
Posts: 13
Joined: Wed Aug 18, 2021 7:10 am
Phoenix Version: v1.0.9.7
Contact:

Re: Add maths to new file

by burt » Fri Mar 27, 2026 1:00 pm

Ensure that you are adding to widerruf file in correct template.
I am not here to build for you.
I am here to build with you. Let's help each other.
User avatar
burt
Core Team
Posts: 4547
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Contact:

Re: Add maths to new file

by amaische » Fri Apr 17, 2026 8:10 am

I have checked and now it works. Thank you very much for your help.
amaische
Member
Posts: 13
Joined: Wed Aug 18, 2021 7:10 am
Phoenix Version: v1.0.9.7
Contact: