PluginProbe
Link Library / trunk
Link Library vtrunk
7.9.7 7.9.6 7.9.5 7.9.4 7.9.3 7.9.2 7.9.1 6.0-Beta11 6.0-Beta12 6.0-Beta2 6.0-Beta3 6.0-Beta4 6.0-Beta5 6.0-Beta6 6.0-Beta7 6.0-Beta8 6.0-Beta9 6.6.8 7.1.4 7.1.5 7.1.6 7.1.7 7.1.8 7.1.9 7.2.0 All 135 releases
link-library / captcha / easycaptcha.php

easycaptcha.php in Link Library trunk, at captcha/easycaptcha.php

27 lines 742 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 require('php-captcha.inc.php');
4
5 $fonts = array('', 'Bd', 'BI', 'It', 'MoBd', 'MoBI', 'MoIt', 'Mono', 'Se', 'SeBd');
6 for($i = 0; $i < count($fonts); $i++ )
7 $fonts[$i] = 'ttf-bitstream-vera-1.10/Vera'.$fonts[$i].'.ttf';
8
9 $alphabet = 'a_b_c_d_e_f_g_h_i_j_k_l_m_n_o_p_q_r_s_t_u_v_w_x_y_z';
10 $alphabet = explode('_', $alphabet);
11 shuffle($alphabet);
12
13 $captchaText = '';
14 for($i = 0; $i < 5; $i++ )
15 {
16 $captchaText .= $alphabet[$i];
17 }
18
19 $time = time();
20
21 setcookie('Captcha', md5("ORHFUKELFPTUEODKFJ".$captchaText.$_SERVER['REMOTE_ADDR'].$time).'.'.$time, null, '/');
22
23 $oVisualCaptcha = new PhpCaptcha($fonts, strlen($captchaText) * 23, 60);
24 $oVisualCaptcha->UseColour(true);
25 $oVisualCaptcha->Create($captchaText);
26
27 ?>