Services_ReCaptcha
[ class tree: Services_ReCaptcha ] [ index: Services_ReCaptcha ] [ all elements ]

Source for file example-03.php

Documentation is available at example-03.php

  1. <?php
  2.  
  3. /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
  4.  
  5. /**
  6.  * This file is part of the PEAR Services_ReCaptcha package.
  7.  *
  8.  * PHP version 5
  9.  *
  10.  * LICENSE: This source file is subject to the MIT license that is available
  11.  * through the world-wide-web at the following URI:
  12.  * http://opensource.org/licenses/mit-license.php
  13.  *
  14.  * @category  Services
  15.  * @package   Services_ReCaptcha
  16.  * @author    David Jean Louis <izi@php.net>
  17.  * @copyright 2008-2009 David Jean Louis
  18.  * @license   http://opensource.org/licenses/mit-license.php MIT License
  19.  * @version   CVS: $Id$
  20.  * @link      http://pear.php.net/package/Services_ReCaptcha
  21.  * @link      http://recaptcha.net/apidocs/captcha/client.html
  22.  * @since     File available since release 0.1.0
  23.  * @filesource
  24.  */
  25.  
  26. /**
  27.  * Include the Services_ReCaptcha class
  28.  */
  29. require_once 'Services/ReCaptcha/MailHide.php';
  30.  
  31. // you must generate your API keys here:
  32. // http://mailhide.recaptcha.net/apikey
  33. $publicKey  'your_public_key';
  34. $privateKey 'your_private_key';
  35.  
  36. // we instanciate our Services_ReCaptcha_MailHide instance with the public key
  37. // and the private key
  38. $mailhide1 = new Services_ReCaptcha_MailHide(
  39.     $publicKey,
  40.     $privateKey,
  41.     'johndoe@example.com'
  42. );
  43.  
  44. $mailhide2 = new Services_ReCaptcha_MailHide(
  45.     $publicKey,
  46.     $privateKey,
  47.     'johndoe@example.com',
  48.     array('link_text' => 'John Doe')
  49. );
  50.  
  51. $mailhide3 = new Services_ReCaptcha_MailHide(
  52.     $publicKey,
  53.     $privateKey,
  54.     'johndoe@example.com'
  55. );
  56. $mailhide3->setOptions(
  57.     array(
  58.         'link_text'    => 'Click here to display my email',
  59.         'link_title'   => 'Some help message',
  60.         'link_title'   => 'Some help message',
  61.         'popup_width'  => 800,
  62.         'popup_height' => 600,
  63.     )
  64. );
  65.  
  66. ?>
  67. <html>
  68. <head>
  69.     <title>recaptcha test</title>
  70. </head>
  71. <body>
  72.     <h2>Hidden emails can be displayed like this:</h2>
  73.     <p><?php echo $mailhide1 ?></p>
  74.     <h2>Like this:</h2>
  75.     <p><?php echo $mailhide2 ?></p>
  76.     <h2>And even like this:</h2>
  77.     <p><?php echo $mailhide3 ?></p>
  78. </body>
  79. </html>

Documentation generated on Mon, 11 Mar 2019 15:43:39 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.