cvs: peardoc /en/package/text/text-captcha-numeral example.xml information.xml intro.xml

From: Date: Sun, 26 Nov 2006 17:47:32 +0000
Subject: cvs: peardoc /en/package/text/text-captcha-numeral example.xml information.xml intro.xml
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-8907@lists.php.net to get a copy of this message
davidc Sun Nov 26 17:47:32 2006 UTC Added files: /peardoc/en/package/text/text-captcha-numeral example.xml information.xml intro.xml Log: - cp copied the CVS directory of course, I am fixing the situation, this is the good location of text-captcha-numeral now. http://cvs.php.net/viewvc.cgi/peardoc/en/package/text/text-captcha-numeral/example.xml?view=markup&rev=1.1 Index: peardoc/en/package/text/text-captcha-numeral/example.xml +++ peardoc/en/package/text/text-captcha-numeral/example.xml <!-- $Id: example.xml,v 1.1 2006/11/26 17:47:31 davidc Exp $ --> <sect2 id="package.text.text-captcha-numeral.example"> <title>Example</title> <para> The following example implements the standard use of a CAPTCHA: Submitted form data is only evaluated when a CAPTCHA has been solved correctly. </para> <example id="package.text.text-captcha-numeral.example.create"> <title>Creating a Numeral CAPTCHA</title> <para> This example is just to show you how to generate a simple mathematic operation with Text_CAPTCHA_Numeral. </para> <programlisting role="php"> require_once 'Text/CAPTCHA/Numeral.php'; $num = new Text_CAPTCHA_Numeral; $operation = $num->getOperation(); /** * This will print the mathematical operation * that has been generated by the package. */ print $operation; </programlisting> </example> <example id="package.text.text-captcha-numeral.example.secure"> <title>Securing a form with a Numeral CAPTCHA</title> <para> This example will show you how to secure a form using the numeral captcha. It takes generates an operation and store it's result into a session variable </para> <programlisting role="php"> <![CDATA[ require_once 'Text/CAPTCHA/Numeral.php'; $numcap = new Text_CAPTCHA_Numeral; if (isset($_POST['captcha']) && isset($_SESSION['answer'])) { if ($_POST['captcha'] == $_SESSION['answer']) { $errors[] = 'Ok.. YOu might be human..'; } else { $errors[] = 'You are or not human or dumb'; } } if (!empty($errors)) { foreach ($errors as $error) { print "<h1><font color='red'>$error</font></h1><br />"; } } print ' <form name="capter" action="index.php?page=liveExample" method="post"> <table> <tr> <th>What is this result pilgrim?: '.$numcap->getOperation().'</th> <td><input type="text" value="" name="captcha" /></td> </tr> <tr> <th/> <td><input type="submit" value="Let me prove you that I am human!" /></td> </tr> </form> '; $_SESSION['answer'] = $numcap->getAnswer(); ]]> </programlisting> </example> </sect2> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/peardoc/en/package/text/text-captcha-numeral/information.xml?view=markup&rev=1.1 Index: peardoc/en/package/text/text-captcha-numeral/information.xml +++ peardoc/en/package/text/text-captcha-numeral/information.xml <!-- $Id: information.xml,v 1.1 2006/11/26 17:47:31 davidc Exp $ --> <sect2 id="package.text.text-captcha-numeral.information"> <title>Information about the Text_CAPTCHA_Numeral and inner workings</title> <para> <classname>Text_CAPTCHA_Numeral</classname> gives you the ability to generate numerical mathematical captchas. </para> <itemizedlist> <listitem> <simpara> <function>getOperation</function> generates the operation that is going to be shown to the end user. </simpara> <simpara> <function>getAnswer</function> Gets the answer of the generated operation's answer. </simpara> </listitem> </itemizedlist> </sect2> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/peardoc/en/package/text/text-captcha-numeral/intro.xml?view=markup&rev=1.1 Index: peardoc/en/package/text/text-captcha-numeral/intro.xml +++ peardoc/en/package/text/text-captcha-numeral/intro.xml <!-- $Id: intro.xml,v 1.1 2006/11/26 17:47:31 davidc Exp $ --> <sect2 id="package.text.text-captcha-numeral.intro"> <title>Introduction</title> <para> This package provides the functionality to create Numeral <acronym>CAPTCHAs</acronym> (Completely Automated Public Turing tests to tell Computers and Humans Apart). Features include: </para> <itemizedlist> <listitem> <simpara> Creating numerical Captchas </simpara> </listitem> <listitem> <simpara> <link linkend="package.text.text-captcha-numeral.information"> Generic information about the Text_CAPTCHA_Numeral </link> </simpara> </listitem> </itemizedlist> <para> The package creates numeral <acronym>CAPTCHAs</acronym>; due to the stateless nature of the HTTP protocol, the logic to secure a webpage using the package must be specifically implemented. See the <link linkend="package.text.text-captcha-numeral.example">usage example</link> for detailled information. </para> <para> Currently </para> </sect2> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->

« previous php.pear.doc (#8907) next »