Implementation of verification code calls under Thinkphp

Source: Internet
Author: User

The class that generated the verification code is located in the thinkphp/extend/library/org/util/image.class.php file.


Verification Code function parameter explanation:

Length: Number of verification codes, default to 4 digits

Model: Verify string type, default to number, other support type has 0 letter 1 digit 2 Capital Letter 3 Lowercase Letter 4 Chinese 5 mix

Type: A picture of the CAPTCHA, default to PNG

Width: Verification code, the default is automatically based on the length of the verification code automatically calculated

Height: The high of the Verification Code, which defaults to 22

VerifyName: The session record name of the verification code, the default is verify.



Use:

Public Function Verify () {

import (' ORG. Util.image ');

Image::buildimageverify (6,5, ' png ', 50,25,veryfy);//fifth parameter, optional, the default is verify, can be replaced according to their own needs.

}


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.