note 80036 added to function.mail
| From: | SIDTRIVEDI at osu1 dot php dot net | Date: | Wed, 26 Dec 2007 04:32:18 +0000 |
| Subject: | note 80036 added to function.mail | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-134007@lists.php.net to get a copy of this message | ||
<?php
/**********************************************
# TITLE : SIMPLE CATCHA
# CONSIDERATION :
#1)AUTO-BOTS CAN NOT DO ARITHMATIC ON STRINGS.
#2) FIRST LETTER OF ANSWER PREFERABLY SHOULD BE CAPITAL - HUMAN BEHAVIOUR.
# CAPTCHA: Telling Humans and Computers Apart Automatically
# A CAPTCHA is a program that protects websites against bots by generating and
# grading tests that humans can pass but current computer programs cannot.
# For example, humans can read distorted text as the one shown below, but current
# computer programs can't:
# IT HELPS :-
# 1) Automatic submission of the form by the auto-bots.
# 2) Worms and Spam. CAPTCHAs also offer a plausible solution against
# email worms and spam:
# The form will only be accept an email if there is a human in-front of
# the computer at other end.
**********************************************/
$numbers = array ("Zero"=>"0", "One" => "1",
"Two" => "2",
"Three" => "3", "Four" => "4",
"Five" => "5",
"Six" => "6", "Seven" => "7",
"Eight" => "8","Nine" => "9");
$answer = array ("0"=>"Zero", "1" => "One",
"2" => "Two",
"3" => "Three", "4" => "Four",
"5" => "Five",
"6" => "Six", "7" => "Seven",
"8" => "Eight",
"9" => "Nine", "10"=>"Ten",
"11" => "Eleven",
"12" => "Twelve","13" =>
"Thirteen");
$input1 = array("Nine", "Eight", "Seven", "Six",
"Five");
$input2 = array("plus", "minus");
$input3 = array("Four", "Three", "Two", "One",
"Zero");
$rand_keys1 = array_rand($input1, 2);
$rand_keys2 = array_rand($input2, 2);
$rand_keys3 = array_rand($input3, 2);
$num1 = $numbers[$input1[$rand_keys1[0]]];
$num2 = $numbers[$input3[$rand_keys3[1]]];
$oprtr = $input2[$rand_keys2[0]];
if ($oprtr === 'plus'){
$ans = $num1 + $num2;
}else{
$ans = $num1 - $num2;
}
$str = $input1[$rand_keys1[0]] .' '.$input2[$rand_keys2[0]].'
'.$input3[$rand_keys3[1]];
echo "$str\n<br>";
$ansr = $answer[$ans];
echo "Answer is : $ansr\n<br>";
/* Above script produces following browser (RANDOM) output:-
Eight plus Two
Answer is : Ten
*/
?>
----
Server IP: 69.147.83.197
Probable Submitter: 208.72.122.206
----
Manual Page -- http://www.php.net/manual/en/function.mail.php
Edit -- https://master.php.net/note/edit/80036
Del: integrated -- https://master.php.net/note/delete/80036/integrated
Del: useless -- https://master.php.net/note/delete/80036/useless
Del: bad code -- https://master.php.net/note/delete/80036/bad+code
Del: spam -- https://master.php.net/note/delete/80036/spam
Del: non-english -- https://master.php.net/note/delete/80036/non-english
Del: in docs -- https://master.php.net/note/delete/80036/in+docs
Del: other reasons-- https://master.php.net/note/delete/80036
Reject -- https://master.php.net/note/reject/80036
Search -- https://master.php.net/manage/user-notes.php