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