The problem with my PHP captcha is this:
Image corrupt or Truncated:http://localhost/htsys/?c=login&m=yzm
No matter how I debug always can not display the captcha picture, prompting the image for its own reasons can not be displayed ...
Tangled Up
Reply to discussion (solution)
Try 1. Image path problem, change the absolute path, or a static diagram on the same path, and exclude if it can be displayed.
Try 2. Image encoding, whether it is a problem at the time of generation, the code that generates the image, a line of debugging.
Generate image code No problem, I changed a lot of verification code class, or so, no words ah,
Public Function Yzm () {///Login Page Verification Code method header ("Content-type:image/png"); $num = $_get[' num ']; $imagewidth =50; $imageheight =20; $numimage = Imagecreate ($imagewidth, $imageheight); Imagecolorallocate ($numimage, 238,97,85); for ($i =0; $i
I get a random string of num from the path and then let the YZM function get the build, it's so simple, really don't know why, just start still good,
public function Yzm () {Header ("content-type:image/png"); $num = $_get[' num '];$ IMAGEWIDTH=50, $imageheight =20; $numimage = Imagecreate ($imagewidth, $imageheight); Imagecolorallocate ($numimage, 238,97,85); for ($i =0; $i