ThinkPHP2.1 Chinese language verification code

Source: Internet
Author: User
ThinkPHP2.1 the Chinese verification code is not displayed when the Chinese verification code of the 2.1 Manual is verified today. I read the information from the internet and found that there was a problem with the code. modify the code as follows ?????????? $ Codex = msubstr ($ code, $ I, 1); the msu ThinkPHP2.1 Chinese verification code called here

When the Chinese verification code of the 2.1 Manual is verified today, the Chinese verification code cannot be displayed.

I read the information from the internet and found that the code was faulty. the modification is as follows:

Set

?????????? $ Codex = msubstr ($ code, $ I, 1 );

The msubstr function called here is in the String class, so it should be modified:

?????????? $ Codex = String: msubstr ($ code, $ I, 1 );

?

There are still a lot of TP bugs. if you want to solve the problem, you still have to look at the source code. The Learning Framework is a process of learning norms. after learning a set of specifications, the framework will be used, to improve the problem-solving capability, you must study the source code.

Public function verify () {import ("ORG. util. image "); header (" Content-Type: text/html; charset = utf-8 "); Image: GBVerify (); // Image: GBVerify (4, 'PNG ', 180,30, 'simhei. ttf', 'verify ');}

? Before importing the font to ORG/util, the default font is 'simhei. ttf'. if you want to change the font, after importing the font, modify the parameters when calling the method.

?

Refer:

Http://blog.sina.com.cn/s/blog_643e09930100gwx2.html

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.