亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

How to save a good verification code image locally in php?
phpcn_u1582
phpcn_u1582 2017-05-16 13:04:04
0
2
692

Use PHP to draw login verification pictures. Since the pictures are taken locally, I don’t want to return the picture in the form of a link. I want to name the drawn verification code picture, then save it to the specified path, and then return a local Give the url address to the front desk, and the front end directly inserts the address in <img src="url"/>. How to achieve this? Thank you~

< /p>

< br>Up to this point, I just output a png image to the browser. How do I name the image and save it locally?

Also, is this approach correct?


Img’s src can be written to death

If the data obtained by ajax is placed in the src of img, an error will be reported

phpcn_u1582
phpcn_u1582

reply all(2)
Peter_Zhu

Don’t generate pictures anymore. Save it every time you refresh. Think about your hard drive space. If you must do this
modify the eighth line

$imgpath = time().rand(10000,99999).'.png';//生成圖片的位置。具體路徑需要指定
imagepng($imge,$imgpath);//報(bào)錯(cuò)圖片
echo $imgpath;//返回圖片地址
淡淡煙草味

$pic = "C:pic.png";
imagepng($im,$pic);

is the local path address

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template