cvs: peardoc /en/package/html html-crypt.xml
| From: | Christian Weiske | Date: | Sun, 26 Nov 2006 22:04:07 +0000 |
| Subject: | cvs: peardoc /en/package/html html-crypt.xml | ||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-8918@lists.php.net to get a copy of this message | ||
cweiske Sun Nov 26 22:04:07 2006 UTC
Modified files:
/peardoc/en/package/html html-crypt.xml
Log:
Explain encryption method
http://cvs.php.net/viewvc.cgi/peardoc/en/package/html/html-crypt.xml?r1=1.1&r2=1.2&diff_format=u
Index: peardoc/en/package/html/html-crypt.xml
diff -u peardoc/en/package/html/html-crypt.xml:1.1 peardoc/en/package/html/html-crypt.xml:1.2
--- peardoc/en/package/html/html-crypt.xml:1.1 Sun Jul 3 21:42:42 2005
+++ peardoc/en/package/html/html-crypt.xml Sun Nov 26 22:04:06 2006
@@ -1,33 +1,37 @@
-<!-- $Revision: 1.1 $ -->
+<!-- $Revision: 1.2 $ -->
<sect1 id="package.html.html-crypt">
<title>HTML_Crypt</title>
<para>
- The <classname>HTML_Crypt</classname> provides methods
- to encrypt text, which can be later be decrypted using
- JavaScript on the client side
-
- This is very useful to prevent spam robots
- collecting email addresses from your site,
- included is a method to add mailto links
- to the text being generated
+ The <classname>HTML_Crypt</classname> provides methods
+ to encrypt text, which can be later be decrypted using
+ JavaScript on the client side.
</para>
<para>
- A basic example to encrypt an email address
- <programlisting role="php">
-<![CDATA[
-
+ This is very useful to prevent spam robots
+ collecting email addresses from your site,
+ included is a method to add mailto links
+ to the text being generated.
+ </para>
+ <example>
+ <title>A basic example to encrypt an email address</title>
+ <programlisting role="php"><![CDATA[
// encrypt 'yourname@emailaddress.com'
// with offset 8
-$c = new HTML_Crypt('yourname@emailaddress.com', 8);
+$c = new HTML_Crypt('yourname@emailaddress.com', 8);
// add <a href="mailto:"></a> around this email
-$c->addMailTo();
-
+$c->addMailTo();
+
// output the javascript wich write the decrypted email.
$c->output();
-
-]]>
- </programlisting>
+]]></programlisting>
+ </example>
+ <para>
+ The "encryption" function is basically works like ROT13,
+ with the difference that the <literal>$offset</literal> setting
+ replaces the 13.
+ It is also limited to ASCII characters between 32 and 127 (included).
+ Other characters will not be encrypted.
</para>
</sect1>
<!-- Keep this comment at the end of the file