ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Developing an application or website / Controls, windows and pages / Controls: Available types / Captcha control
  • Overview of Captcha control
  • Creating a Captcha control
  • Configuring a Captcha control
  • Handling a Captcha control
  • Implementation and use
  • Event handled by default
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Overview of Captcha control
The "captcha" are the distorted texts that the Web user must decode and re-enter in a site before validating a form.
The purpose of the "captcha" is to prevent the hackers from attacking a site via a robot that would enter cascading information.
By implementing this type of security in a form, you can be almost sure that the information was entered by a human being!
The principle is straightforward: the Captcha control automatically calculates and displays the distorted image corresponding to a text. This text is automatically generated by the control or defined by the application.
Creating a Captcha control
To create a Captcha control:
  1. On the "Creation" tab, in the "Graphic controls" group, click "Captcha".
  2. Click where you want to create the control in the page. The control appears in the editor.
To view the characteristics of the control, select "Description" in the context menu.
Remark: WEBDEV includes several Smart controls that can be used to create Captcha controls. To view and use these controls, go to the "Creation" tab, "Graphic controls" group and expand "Captcha". The available Smart controls are:
  • Captcha security code
  • Button protected by Google reCaptcha
  • Button protected by Google reCaptcha with check box.
You can adapt the code of these Smart controls.

Configuring a Captcha control

Several characteristics of the Captcha control can be modified in the editor, in the description window of the control ("Description" in the context menu of the control).
In the "General" tab, you can define:
  • the number of characters that must be displayed in the Captcha control.
  • the range of authorized characters: lowercase characters and/or uppercase characters and/or digits.
In the "Style" tab, you have the ability to define:
  • the color of captcha.
  • the font used. We recommend that you use simple fonts in order for the captcha to be legible.
Handling a Captcha control

Implementation and use

To use a Captcha control:
  1. Create the Captcha control and modify its characteristics if necessary (font, range of characters, ...). Create an edit control in which the Web user will enter the value of the captcha.
  2. Initialize the Captcha control with the requested value. You can:
    • use CaptchaDisplay. This function is used to generate a random value for the captcha according to the specified parameters.
    • assign a value to the Captcha control via a simple assignment:
      <Name of Captcha Control> = <Captcha Value>

      For example:
      CPTCH_Captcha = "ToTo1567"
    Tip: Depending on the letters and digits used by the captcha, this one may be difficult to decode. Don't forget to create a button used to generate a new captcha upon request. All you have to do is call CaptchaDisplay in the code of the button to get a new captcha. You will notice that algorithm used to build the captcha changes for each display, increasing the security level automatically. The distortion changes for each display.
  3. Checks whether the value typed by the Web user corresponds to the Captcha control via CaptchaVerify.
Remarks:
  • The Captcha controls can also be handled via the prefix syntax of Captcha functions.
  • Several properties are used to modify the aspect of a Captcha control. For more details, see Captcha control properties.
  • To use a Captcha control in an application that supports specific character sets, you can:
    • use a Google captcha suggested by the Smart controls. The captcha will use characters supported in the current language.
    • use the Captcha control and allow numbers only (option available in the "General" tab of the control description).
Event handled by default
WEBDEV handles the following event by default:
EventRuntime condition
Initializing (Server code)Executed when the page is opened.
Related Examples:
WW_Blog_AWP Complete examples (WEBDEV): WW_Blog_AWP
[ + ] This example is a site for managing blogs.
A blog is a log or a diary on an Internet site.
It can be consulted by everyone and everyone can write comments.
The author of the blog writes his messages whenever he wants to.
You have the ability to format the text, to include images, notes, etc.
This example is based on an AWP generation so that the site can be referenced by all the search engines.
Furthermore, each blog can e exported in RSS. (Use of the RSS types of WLanguage)
The Captcha control Unit examples (WEBDEV): The Captcha control
[ + ] This example explains how to use the "Captcha" control of WEBDEV.
This control allows you to avoid the automatic inputs in the forms.
Minimum version required
  • Version 16
Comments
Click [Add] to post a comment

Last update: 06/23/2023

Send a report | Local help