首頁  >  問答  >  主體

驗證碼的程式碼在哪裡複製運行我打了程式碼大部分但是在最後也許是沒打完運訓出錯未定義的方法

<?php

check_codo();

//$img = imagecreate($width,$height);//建立畫布並且傳入兩個變數寬高

function check_codo($width = 100,$height = 50,$num = 4, $type = 'jpeg'){

$img = imagecreate($width, $height);

$string = '';

for ($i = 0;$i < $num;$i ) {

$rand = mt_rand(0,2) ;

switch ($rand) {

case 0:

# $ascll = mt_rand(48,57);//0-9

# break ;

case 1:

$ascll = mt_rand(65,90);//A-Z

break;

case 2:

$ascll = mt_rand(97,122);//a-z

break;

}

$string = sprintf('$c',$ascll);

}

//背景顏色

imagefilledrectangle($img, 0, 0, $width, $height, randBg($img));

/ /幹擾元素

for ($i=0; $i < 50; $i ) {

imagesetpixel($img, mt_rand(0,$width),mt_rand(0,$ height),randPix($img)); 

# code...

# }

//寫字

# for ($i=0; $i < $num; $i ) { 

$x = floor($width / $num) * $i 2;

}


#}

?>


。水波不清。水波不清1958 天前1133

全部回覆(0)我來回復

無回覆
  • 取消回覆