root/wp-email/trunk/email-image-verify.php

Revision 50002, 1.7 kB (checked in by GamerZ, 4 weeks ago)

Fixed MYSQL Charset Issue

Line 
1 <?php
2 /*
3 +----------------------------------------------------------------+
4 |                                                                                            |
5 |    WordPress 2.5 Plugin: WP-EMail 2.31                                        |
6 |    Copyright (c) 2008 Lester "GaMerZ" Chan                                    |
7 |                                                                                            |
8 |    File Written By:                                                                    |
9 |    - Lester "GaMerZ" Chan                                                            |
10 |    - http://lesterchan.net                                                            |
11 |                                                                                            |
12 |    File Information:                                                                    |
13 |    - E-Mail Image Verification                                                        |
14 |    - wp-content/plugins/wp-email/email-image-verify.php                |
15 |                                                                                            |
16 +----------------------------------------------------------------+
17 */
18
19
20 ### Start Session
21 @session_start();
22
23 ### Captial Letters And Numbers
24 $alphanum = "ABCDEFGHJKLMNPQRSTUVWXYZ23456789";
25
26 ### Generate The Verfication Code
27 $rand = substr(str_shuffle($alphanum), 0, 5);
28
29 ### MD5 The Code And Assign It To Session
30 $_SESSION['email_verify'] = md5($rand);
31
32 ### Create The Image (60x22)
33 $image = imagecreate(55, 15);
34
35 ### Use White As The Background Color
36 $bgColor = imagecolorallocate($image, 255, 255, 255);
37
38 ### Use Black As The Text Color
39 $textColor = imagecolorallocate($image, 0, 0, 0);
40
41 ### Output The Code To The Image
42 imagestring($image, 5, 5, 1, $rand, $textColor);
43
44 ### Date In The Past
45 header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
46
47 ### Always Modified
48 header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
49
50 ### HTTP 1.1
51 header("Cache-Control: no-store, no-cache, must-revalidate");
52 header("Cache-Control: post-check=0, pre-check=0", false);
53
54 ### HTTP 1.0
55 header("Pragma: no-cache");
56
57 ### Set The Header To Be JPG
58 header('Content-type: image/jpeg');
59
60 ### Send The Image To The Browser
61 imagejpeg($image);
62
63 ### Destroy The Image
64 imagedestroy($image);
65 ?>
Note: See TracBrowser for help on using the browser.