《22期PHP线上直播班》开课啦!
立即报名细碎的阳光如你一般温和5年前
有个地方错了。 $captch_code=$fontContent;这里应该改为$captch_code.=$fontContent; 不然$captch_code只输出一个字符
华5年前
前期的session存储验证信息有点出错吧?$captch_code没有存到验证码数组,只是保存了最后一个验证码,如:验证码是“A66B”,那么$_SESSION['code']只保存了B。导致form页面验证一直出错。只打最后一个B则输入正确。 因为strtolower($_REQUEST['code']) == $_SESSION['code']不相等
Juan~5年前
我也是用<img src="yzm.php" alt="看不清,请换一张" onclick="this.src=this.src+'?'+new Date().getTime():" />不得行 后面换成<img src="yzm.php" alt="看不清,请换一张" oncl
华5年前
小白我这样修改了一下代码,测试后可以使用,不知道修改的对不对。 修改如下:1.先是定义了$captch_code为空字符串数组,$captch_code = " "; 2.$fontcontent这里的截取长度strlen减一,不然会出现图片错误,$fontcontent = substr($data,rand(0,strlen($data)-1),1); 3.for循环将$