<?php
check_code();
//Randomly generate characters or numbers for the verification code
function check_code($width=100, $height=50,$num=4, $type='jpeg')
{
$i=imagecreate($width,$height) ;
$string=''; =mt_rand(0,2);
switch($rand)
switch($rand) ;
break;
case 1:
case 2 :
$ascii=mt_rand(97,122);
break; ;//Ascii character decoding
}
//Generate verification code background color (randbg(): function call)
imagefilledrectangle($i,0,0,$width,$height,randbg($i));
//Generate random interference (randpix(): function Call)for($j=0;$j<50;$j )
{
imagesetpixel($i, mt_rand(0,$width),mt_rand(0,$height) ,randpix($i));
}
//Writing
for($j=0;$j<$num;$j )
{
}
else
{
//Interference element or character color function module
function randpix($i)
{
return imagecolorallocate($i,mt_rand(0,135),mt_rand (0,135),mt_rand(0,135));
}
?>
##
Post the error message, who has time to read your code? ? ?