Home  >  Article  >  Backend Development  >  php-PHP做了一个验证码,之前一直好好的,但突然就用不了了,加载不出来了!

php-PHP做了一个验证码,之前一直好好的,但突然就用不了了,加载不出来了!

WBOY
WBOYOriginal
2016-06-02 11:28:281233browse

验证码php函数

<code> function verifyImg($width=80,$height=30){//定义画布$img=imagecreatetruecolor($width, $height);//定义颜色$white=imagecolorallocate($img, 255, 255, 255);$black=imagecolorallocate($img, 0, 0, 0);//画出画布imagefilledrectangle($img, 1, 1, $width-2, $height-2, $white);//写字$size=mt_rand(18,22);$angle=mt_rand(-3,3);$x=mt_rand(2,10);$y=mt_rand(20,28);$fontfiles='../font/simhei.ttf';$_SESSION['verify']=$str=randomStr();imagettftext($img, $size, $angle, $x, $y, $black,$fontfiles ,$str);//增加干扰点for($i=0;$i</code>

请大神帮小弟看看是哪里出了问题了!
搞得我毫无头绪!
之前一直用得好好的,突然间就用不了了!
GD库是开了的啊!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn