문제

I have installed CAPTCHA extra on MODx Revolution. According to its description

"The Captcha components can also be used by other components to create captcha-style verification for front-end forms."

When changing captcha.enabled in System setting to Yes, it adds Captcha to manager login, but there's no documentation on how to use it on other components, neither I could find any example by googling.

How can I use the Captcha on a desired form? (and not on manager login if possible)

Thanks for your time.

도움이 되었습니까?

해결책

You add it somewhere in your form where you want it to appear:

<img src="[[++assets_url]]components/captcha/captcha.php" alt="Captcha Image" />

And create a textfield for user to enter the result. Then wherever you're doing the validation for your form, compare the value of the textfield to $_SESSION['veriword'].

You can also read this: http://bobsguides.com/captcha-plugin.html

다른 팁

The docs are limited - but there, in the docs folder of the distribution:

Modx Captcha Utility
====================
Author: BobRay <bobray@softville.com>
Date:   08/10/2008
Updated:10/03/2010
====================

This utility provides captcha verification in the MODx
Manager login and elsewhere.

It uses the following System Settings:

captcha.enabled            If set, captcha is used for Manager login (off when installed)
captcha.use_mathstring     If set, the image is a simple equation for the user to solve (on when installed)
captcha.words              Selection of words used for the image if captcha_use_mathstring is off
captcha.height             Height of image (default: 80)
captcha.width              Width of image (default: 200)
captcha.words              Words to use in CAPTCHA challenge

You may add or delete fonts from the core/components/captcha/fonts directory
as long as there is at least one .ttf file there.

You may add or delete images from the core/components/captcha/noise directory
as long as there is at least one file there.

Captcha can also be used in other forms that require captcha.

You can roll your own function by calling assets/components/captcha/captcha.php where you want the image
and then comparing the user's input to the $_SESSION['veriword'] variable.

See the code in the core/components/captcha/captcha.plugin.php file.

You should also be able to see this from the properties of the installed package in the package manager.

Basically, what he is saying that you ~can~ use it for other forms 'if you want to write a little bit of code'

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top