Your browser must have JavaScript enabled in order to view this page.
 >  >
 
Welcome Guest#217 Login/register    Go to Bottom
Go to Top

Source for file dpcaptcha.php

Documentation is available at dpcaptcha.php

  1. <?php
  2. /**
  3.  * Shows a CAPTCHA code image for a given database Id.
  4.  *
  5.  * DutchPIPE version 0.4; PHP version 5
  6.  *
  7.  * LICENSE: This source file is subject to version 1.0 of the DutchPIPE license.
  8.  * If you did not receive a copy of the DutchPIPE license, you can obtain one at
  9.  * http://dutchpipe.org/license/1_0.txt or by sending a note to
  10.  * license@dutchpipe.org, in which case you will be mailed a copy immediately.
  11.  *
  12.  * @package    DutchPIPE
  13.  * @subpackage public
  14.  * @author     Lennert Stock <ls@dutchpipe.org>
  15.  * @copyright  2006, 2007 Lennert Stock
  16.  * @license    http://dutchpipe.org/license/1_0.txt  DutchPIPE License
  17.  * @version    Subversion: $Id: dpcaptcha.php 278 2007-08-19 22:52:25Z ls $
  18.  * @link       http://dutchpipe.org/manual/package/DutchPIPE
  19.  * @see        dpclient.php
  20.  */
  21.  
  22. $config_dir realpath(dirname(isset($_SERVER['SCRIPT_FILENAME'])
  23.     ? $_SERVER['SCRIPT_FILENAME': __FILE__'/../config');
  24.  
  25. /**
  26.  * Gets server settings
  27.  */
  28. require_once($config_dir '/dpserver-ini.php');
  29.  
  30. /**
  31.  * Gets universe settings
  32.  */
  33. require_once($config_dir '/dpuniverse-ini.php');
  34.  
  35. /**
  36.  * Gets I18N/L10 dp_text functionality (if enabled)
  37.  */
  38. require_once(DPSERVER_LIB_PATH 'dptext.php');
  39.  
  40.  
  41.     || die(sprintf(dp_text('Could not connect: %s<br />')mysql_error()));
  42.  
  43.     || die(sprintf(dp_text('Failed to select database: %s<br />',
  44.  
  45. if (!isset($_GET|| !isset($_GET['captcha_id'])
  46.         || !($result mysql_query(
  47.         "SELECT captchaFile FROM Captcha WHERE captchaId='"
  48.         . $_GET['captcha_id'"'"))
  49.         || FALSE === ($row mysql_fetch_array($result))) {
  50.     die(dp_text('Failed to retrieve CAPTCHA image information.<br />'));
  51. }
  52.  
  53. $captcha_image file_get_contents(DPUNIVERSE_CAPTCHA_IMAGES_PATH $row[0]);
  54. if (FALSE === $captcha_image{
  55.     die(dp_text('Failed to retrieve CAPTCHA image file.<br />'));
  56. }
  57.  
  58. header('Content-Type: image/gif');
  59. header('Cache-Control: no-cache, must-revalidate')// HTTP/1.1
  60. header('Expires: Mon, 26 Jul 1997 05:00:00 GMT')// Date in the past
  61. echo $captcha_image;
  62. ?>

Documentation generated on Mon, 03 Sep 2007 22:18:48 +0200 by phpDocumentor 1.3.0RC6

Click me!
Guest#217
 
 
 
  Go to Top
 
 
Input Field OptionsClose Input Field Go to Top
 
Legal Notices | Copyright © 2006, 2007 Lennert Stock. All rights reserved. Last update: Mon Sep 03 2007, 21:50 CET.