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

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

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

function AntiSpam($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()
Returns
AntiSpam
See also
AntiSpam::Set and AntiSpam::Rand

Example

$spam = new AntiSpam();

function 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.
Returns
The generated spam challenge string

Example

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

function 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);

function Stroke($aStrokeFileName)
Send the antispam image back to the browser

Argument | Default | Description
--- | --- | ---
$aStrokeFileName |  | An optional file name

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

Example

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