mirror of
https://github.com/claudehohl/Stikked.git
synced 2025-04-25 20:41:20 -05:00
generate word
This commit is contained in:
parent
e84a1e1451
commit
3dd8dcf323
@ -388,7 +388,25 @@ class Main extends CI_Controller
|
||||
function captcha()
|
||||
{
|
||||
$this->load->helper('captcha');
|
||||
$this->load->view('view/captcha');
|
||||
|
||||
//get "word"
|
||||
$pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
||||
$str = '';
|
||||
for ($i = 0;$i < 4;$i++)
|
||||
{
|
||||
$str.= substr($pool, mt_rand(0, strlen($pool) - 1) , 1);
|
||||
}
|
||||
$word = $str;
|
||||
|
||||
//save
|
||||
$this->db_session->set_userdata(array(
|
||||
'captcha' => $word
|
||||
));
|
||||
|
||||
//view
|
||||
$this->load->view('view/captcha', array(
|
||||
'word' => $word
|
||||
));
|
||||
}
|
||||
|
||||
function _valid_lang($lang)
|
||||
|
@ -1,3 +1,3 @@
|
||||
<?php
|
||||
header('Content-type: image/jpeg');
|
||||
display_captcha();
|
||||
display_captcha($word);
|
||||
|
Loading…
x
Reference in New Issue
Block a user