0
即時得到Mozilla的PHP的驗證碼無法正常工作
「的形象 ‘* /form%20and%20its%20validation/New%20folder/captcha/captcha.php’這個錯誤 不能因爲它包含錯誤而被顯示。「
fonts.ttf位於同一個文件夾中。
和此代碼在chrome上沒有顯示任何內容。這段代碼有什麼問題?
我想包括這在我的表單頁面..
$rnum='';
//generating random number
$rnum = rand(100000,9999999);
//creating image with size 300*60
$imgo = imagecreatetruecolor(300,60);
$white = imagecolorallocate($imgo, 255, 255, 255);
$grey = imagecolorallocate($imgo, 128, 128, 128);
$red = imagecolorallocate($imgo, 200, 100,90);
$black = imagecolorallocate($imgo, 0, 0, 0);
imagefilledrectangle($imgo, 0, 0, 200, 35, $black);
//getting font
$cfont= 'font.ttf';
imagettftext($imgo, 35, 0, 22, 24, $red, $cfont, $rnum);
header ("Content-type: image/png");
imagepng($imgo);
imagedestroy($imgo);