Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
securimage_show.php
1 <?php
2 
3 /**
4  * Project: Securimage: A PHP class for creating and managing form CAPTCHA images<br />
5  * File: securimage_show.php<br />
6  *
7  * Copyright (c) 2011, Drew Phillips
8  * All rights reserved.
9  *
10  * Redistribution and use in source and binary forms, with or without modification,
11  * are permitted provided that the following conditions are met:
12  *
13  * - Redistributions of source code must retain the above copyright notice,
14  * this list of conditions and the following disclaimer.
15  * - Redistributions in binary form must reproduce the above copyright notice,
16  * this list of conditions and the following disclaimer in the documentation
17  * and/or other materials provided with the distribution.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29  * POSSIBILITY OF SUCH DAMAGE.
30  *
31  * Any modifications to the library should be indicated clearly in the source code
32  * to inform users that the changes are not a part of the original software.<br /><br />
33  *
34  * If you found this script useful, please take a quick moment to rate it.<br />
35  * http://www.hotscripts.com/rate/49400.html Thanks.
36  *
37  * @link http://www.phpcaptcha.org Securimage PHP CAPTCHA
38  * @link http://www.phpcaptcha.org/latest.zip Download Latest Version
39  * @link http://www.phpcaptcha.org/Securimage_Docs/ Online Documentation
40  * @copyright 2012 Drew Phillips
41  * @author Drew Phillips <drew@drew-phillips.com>
42  * @version 3.2RC2 (April 2012)
43  * @package Securimage
44  *
45  */
46 
47 // Remove the "//" from the following line for debugging problems
48 // error_reporting(E_ALL); ini_set('display_errors', 1);
49 
50 require_once dirname(__FILE__) . '/securimage.php';
51 
52 $img = new Securimage();
53 
54 // You can customize the image by making changes below, some examples are included - remove the "//" to uncomment
55 
56 //$img->ttf_file = './Quiff.ttf';
57 //$img->captcha_type = Securimage::SI_CAPTCHA_MATHEMATIC; // show a simple math problem instead of text
58 //$img->case_sensitive = true; // true to use case sensitve codes - not recommended
59 //$img->image_height = 90; // width in pixels of the image
60 //$img->image_width = $img->image_height * M_E; // a good formula for image size
61 //$img->perturbation = .75; // 1.0 = high distortion, higher numbers = more distortion
62 //$img->image_bg_color = new Securimage_Color("#0099CC"); // image background color
63 //$img->text_color = new Securimage_Color("#EAEAEA"); // captcha text color
64 //$img->num_lines = 8; // how many lines to draw over the image
65 //$img->line_color = new Securimage_Color("#0000CC"); // color of lines over the image
66 //$img->image_type = SI_IMAGE_JPEG; // render as a jpeg image
67 //$img->signature_color = new Securimage_Color(rand(0, 64),
68 // rand(64, 128),
69 // rand(128, 255)); // random signature color
70 
71 // see securimage.php for more options that can be set
72 
73 
74 
75 $img->show(); // outputs the image and content headers to the browser
76 // alternate use:
77 // $img->show('/path/to/background_image.jpg');