HTML_QuickForm_CAPTCHA
[ class tree: HTML_QuickForm_CAPTCHA ] [ index: HTML_QuickForm_CAPTCHA ] [ all elements ]

Class: HTML_QuickForm_CAPTCHA

Source Location: /HTML_QuickForm_CAPTCHA-0.3.0/HTML/QuickForm/CAPTCHA.php

Class Overview

HTML_QuickForm_input
   |
   --HTML_QuickForm_CAPTCHA

Common class for HTML_QuickForm elements to display a CAPTCHA


Author(s):

Version:

  • Release: 0.3.0

Copyright:

  • 2006-2008 by Philippe Jausions / 11abacus

Variables

Methods


Child classes:

HTML_QuickForm_CAPTCHA_Equation
Element for HTML_QuickForm to display a CAPTCHA equation question
HTML_QuickForm_CAPTCHA_Figlet
Element for HTML_QuickForm to display a CAPTCHA figlet
HTML_QuickForm_CAPTCHA_Image
Element for HTML_QuickForm to display a CAPTCHA image
HTML_QuickForm_CAPTCHA_Word
Element for HTML_QuickForm to display a CAPTCHA "word" question

Inherited Variables

Inherited Methods


Class Details

[line 83]
Common class for HTML_QuickForm elements to display a CAPTCHA

The HTML_QuickForm_CAPTCHA package adds an element to the HTML_QuickForm package to display a CAPTCHA question (image, riddle, etc...)

This package requires the use of a PHP session ($_SESSION).

Because the CAPTCHA element is serialized in the PHP session, you need to include the class declaration BEFORE the session starts. So BEWARE if you have php.ini session.auto_start enabled, you won't be able to use this element, unless you're also using PHP 5's __autoload() or php.ini's unserialize_callback_func setting



[ Top ]


Class Variables

$_CAPTCHA_driver =

[line 102]

CAPTCHA driver
  • Access: protected

Type:   string


[ Top ]

$_options = array(
            'sessionVar' => '_HTML_QuickForm_CAPTCHA',
            'phrase'     => null,
            )

[line 91]

Default options
  • Access: protected

Type:   array


[ Top ]



Method Detail

HTML_QuickForm_CAPTCHA (Constructor)   [line 121]

HTML_QuickForm_CAPTCHA HTML_QuickForm_CAPTCHA( [string $elementName = null], [mixed $elementLabel = null], [array $options = null], [mixed $attributes = null])

Class constructor
  • Access: public

Parameters:

string   $elementName     Name
mixed   $elementLabel     Label for the CAPTCHA
array   $options     Options for the Text_CAPTCHA package
  • 'sessionVar' (string) name of session variable containing the Text_CAPTCHA instance (defaults to _HTML_QuickForm_CAPTCHA.)
  • Other options depend on the driver used
mixed   $attributes     HTML Attributes for the <a> tag surrounding the image. Can be a string or array.

[ Top ]

destroy   [line 226]

void destroy( )

Destroys the CAPTCHA instance to prevent reuse
  • Access: public

[ Top ]

exportValue   [line 194]

string exportValue( mixed &$submitValues, [boolean $assoc = false])

Returns the answer/phrase of the CAPTCHA
  • Access: public

Parameters:

mixed   &$submitValues     Ignored by this element
boolean   $assoc     Whether to return an array

[ Top ]

getValue   [line 176]

string getValue( )

Returns the answer/phrase of the CAPTCHA
  • Access: public

[ Top ]

setPhrase   [line 211]

void setPhrase( [string $phrase = null])

Sets the CAPTCHA question/phrase

Pass NULL or no argument for a random question/phrase to be generated

  • Access: public

Parameters:

string   $phrase     Value of the CAPTCHA to set

[ Top ]

toHtml   [line 240]

string toHtml( )

Returns the HTML for the CAPTCHA

This can be overwritten by sub-classes for specific output behavior (for instance the Image CAPTCHA displays an image)

  • Access: public

Overridden in child classes as:

HTML_QuickForm_CAPTCHA_Figlet::toHtml()
Returns the HTML for the CAPTCHA
HTML_QuickForm_CAPTCHA_Image::toHtml()
Returns the HTML for the CAPTCHA image

[ Top ]

_initCAPTCHA   [line 139]

boolean _initCAPTCHA( )

Initializes the CAPTCHA instance (if needed)
  • Return: TRUE or PEAR_Error on error
  • Access: protected

[ Top ]


Documentation generated on Sat, 26 Apr 2008 20:00:05 -0400 by phpDocumentor 1.4.0. PEAR Logo Copyright © PHP Group 2004.