How do I obtain the verification code Image for logon?

Source: Internet
Author: User
There will be a verification code upon login. after reading the code, its src points to a PHP address (maybe not the PHP address, so src & quot; loginverificationCode? 0.8308222951445625 & quot;). open this address separately and garbled characters are displayed. how can I put this image down? It is... a verification code will be generated during login. after reading the code, its src points to a PHP address (it may not be a PHP address, so src="/login/verificationCode?0.8308222951445625"), Open this address separately, and garbled characters appear. could you please ask how to put this picture down? Prepare for the next verification code. Have you studied any related Friends? thank you!

Reply content:

There will be a verification code upon login. after reading the code, its src points to a PHP address (maybe not the PHP address, this waysrc="/login/verificationCode?0.8308222951445625"), Open this address separately, and garbled characters appear. could you please ask how to put this picture down? Prepare for the next verification code. Have you studied any related Friends? thank you!

This is not garbled. it is only the binary stream of jpg, gif, and png. it is jpeg or png. you need to check the first few digits of the binary stream, and there will be a mark such as JPEG in the previous one.

This binary stream is saved1.jpgThe result is displayed.

Or set the content-type to image/jpeg during the request, so that the request can be directly viewed.

It is recommended that the subject take a look at the TP verification code generation to understand the meaning of the signature.

Verification code

Same problem

Then you can see

Generally, verification code images are not stored or cached.
Re-access to this link will only generate new images. Therefore, you must store the images and then call them.

Previously in the project, we used js to call the interface to encrypt the binary stream resource of the verification code Image and transmit it to the client using base64_encode.
You can refer to the implementation method below

Has the landlord solved this problem? I am also encountering this problem.

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.