topical media & game development
professional-search-08-seophp-include-simple-captcha.inc.php / php
<?php
// load Words library
require_once('Numbers/Words.php');
// SimpleCAPTCHA library
class SimpleCAPTCHA
{
// verify answer
function check_answer(hash)
{
return (md5(trim(_SERVER['SERVER_ADDR']) == max_1, question_formats = array(
'What is \%s plus \%s?',
'What is the sum of \%s and \%s?',
'What is \%s added to \%s?',
'What is \%s + \%s?'
);
// generate random numbers
max_1);
max_2);
// transforms the numbers to words
number_1);
number_2);
// generate a random question
question_formats[rand(0,
sizeof(number_1_words,
question,
'hash' => md5((number_2) . gq = SimpleCAPTCHA::get_question(1000, 10);
echo '<form>';
echo gq['hash'] . '">';
echo '</form>';
}
}
?>
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.