The verification code is an image. how can I verify that the verification code is consistent in the background?
Source: Internet
Author: User
The verification code is an image. how does one verify the consistency of user input in the background? The user entered the verification code on the verification diagram, but how does the program know that it is the same as the image ?, The image is generated by php, and the string used to generate the image is retained. then, the user input is compared with the string. the background, interference point, and interference line in the verification code are the generated image, the character string is generated by your own program. we recommend that you use the SESSION verification code as an image. how can we verify the consistency of user input in the background?
The user entered the verification code on the verification diagram, but how does the program know that it is the same as the image?
------ Solution --------------------
Images generated by php
------ Solution --------------------
Retain the string used to generate the image
Then compare the user input with the string
------ Solution --------------------
The background, interference points, and interference lines in the verification code are generated images. the strings in the verification code are generated by your own program. we recommend that you use SESSION to save them.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.