Home > Backend Development > PHP Tutorial > 验证码是图片,后台如何验证用户输入的一致呢

验证码是图片,后台如何验证用户输入的一致呢

WBOY
Release: 2016-06-13 13:38:55
Original
1595 people have browsed it

验证码是图片,后台怎么验证用户输入的一致呢?
用户输入了验证图上的验证码,但程序怎么知道是跟图片一样的字?

------解决方案--------------------
图片由php生成
------解决方案--------------------
保留用于 生成图片的字符串
然后将用户的输入和这个字符串比较
------解决方案--------------------
验证码里面的背景,干扰点,干扰线是生成的图片,里面的字符串是你自己用程序生成的,建议你用SESSION保存.

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template