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

ArgumentDefaultDescription
$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

ArgumentDefaultDescription
$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:

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:

Example:

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

 

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

ArgumentDefaultDescription
$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:

Example:

$spam = new AntiSpam();