Class AntiSpam
(Defined in: jpgraph_antispam.php : 546)

AntiSpam
Rand() Set() Stroke() __construct()

Class usage and Overview
This module is used to create AntiSpam challenges that can be used to prevent automatic signup by robots on WEB-pages.

Class Methods

AntiSpam ::
Rand($aLen)
Generate a random spam challenge string

Argument | Default | Description
--- | --- | ---
$aLen |  | Sets the length of the generated string

Description:
Instead of specifying the string manually that should be used as a challenge the string can be automatically generated. This is done witha call to the Rand() method.

Example:

$antispam = new AntiSpam();
$rval = $antispam->Rand();
...

AntiSpam ::
Set($aData)
Set the spam challenge string

Argument | Default | Description
--- | --- | ---
$aData |  | Spam challenge

Description:
This is an alternative way of specifying the AntiSpam string. This can also be specified in the initial creation of the ANtiSpam object ro be automatically generated with a call to the Rand() method
See also:

- AntiSpam::Rand()

Example:

$antispam = new AntiSpam();
...
$antispam->Set($mySpamVal);

AntiSpam ::
Stroke()
Send the antispam image back to the browser

Description:
This sends the antispam image back to the browser or to an optional file named as the first and only argument.
See also:

- AntiSpam::__construct()
- AntiSpam::Rand()

Example:

$antispam = new AntiSpam();
$rval = $antispam->Rand();
...
$antispam->Stroke()

AntiSpam ::
__construct($aData)
Create a new ANtiSpam challenge image

Argument | Default | Description
--- | --- | ---
$aData | '' | Data to be displayed

Description:
This method creates a new instance of the AntiSpam challenge. When the anti-spam imga eis created it is possible to directly use a supplied data string that should be displayed. The data can also be added afterwards with a call to Set()
See also:

- AntiSpam::Set()
- AntiSpam::Rand()

Example:

$spam = new AntiSpam();