You need to use the php GD library to generate the graphical verification code. If you do not have an account with the GD library, we need to find extension=php_gd2.dll in the php.ini file and remove the previous ";" and then restart the apache or iis environment.
foreach(gd_info() as $cate=>$value)
echo "$cate: $ value
";
}else
echo 'You do not have gd extension installed';
?>
If there is return information, it is correct and can be used frequently
Example 1
Example 2
An example of generating verification code developed using PHP, combined with session and GD library extensions (recommended by w3c), which can be easily used in projects. And the style is beautiful
"green" => 0xFF & ($int >> 0x8),
"blue" => 0xFF & $int);
}
推荐第二个生成验证码程序代码,最后一个是W3C标准生成的也是利用了php gd库。