randomness

This commit is contained in:
Claude 2012-06-12 21:27:18 +02:00
parent 6e2d0ecc46
commit 7c28f36d0a
2 changed files with 8 additions and 2 deletions

View File

@ -401,7 +401,7 @@ class Main extends CI_Controller
$this->load->helper('captcha');
//get "word"
$pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@';
$str = '';
for ($i = 0;$i < 4;$i++)
{

View File

@ -4,6 +4,7 @@
* Function list:
* - create_captcha()
* - display_captcha()
* - b()
* Classes list:
*/
@ -362,7 +363,12 @@ if (!function_exists('display_captcha'))
// -----------------------------------
$bg_color = imagecolorallocate($im, 255, 255, 255);
function b()
{
return mt_rand(240, 255);
}
$bg_color = imagecolorallocate($im, b() , b() , b());
$border_color = imagecolorallocate($im, 153, 102, 102);
$text_color = imagecolorallocate($im, 204, 153, 153);
$grid_color = imagecolorallocate($im, 255, 182, 182);