Proposal for "Text_CAPTCHA_Numeral"

» Metadata » Status
» Description
This is a simple driver that we can add to Text_CAPTCHA that will give the ability to create mathematical numeral captchas as such as:


Prove that you are human by telling me the answer to this:
54 + 12

It is strictly for php5 but can be easily ported back to php4.

To be quick you do this:

<?php

/**
 * Start the sesssion
 */
session_start();

/**
 * The class itself.
 */
require_once 'Text/CAPTCHA/Numeral.php';

/**
 * The instantiation
 */
$new = Text_CAPTCHA_Numeral;

/**
 * Get an operation
 */
print 'Operation is: ' . $new->getOperation();

/**
 * Get this operation's answer and store into session
 */
$_SESSION['answer'] = $new->getAnswer(); 
?>

see the live example for a working version:
http://dev.agoraproduction.com/pear/Numeral/?file=example2

Game MENANG123

» Dependencies » Links
» Timeline » Changelog
  • First Draft: 2006-10-16
  • Proposal: 2006-10-16
  • Call for Votes: 2006-10-30
  • David Coallier
    [2006-10-16 20:09 UTC]

    - Added return in the doSubstract() function so the code doesn't run for nothing

  • David Coallier
    [2006-10-17 00:58 UTC]

    - Added value swapping when the first substract value is smaller than the second one. (It's swapping with the first one)
    - Removed useless cast into setAnswer()

  • David Coallier
    [2006-10-21 01:46 UTC]

    Made Text_CAPTCHA_Numera it's own package and removed useless recursion, now it's only reseting the operation and not generateOperation() completely

  • David Coallier
    [2006-10-30 15:14 UTC]

    - I have made the changes everyone needed/wanted so I it's time for votes.

  • Thies C. Arntzen
    [2023-12-08 07:39 UTC]