The example in this article describes the simple implementation method of thinkPHP3.1 verification code. Share it with everyone for your reference, the details are as follows:
Write in the code:
public function verify(){ import('ORG.Util.Image'); ob_clean(); Image::buildImageVerify(); }
Write in the html:
<img src='__APP__/Index/verify/' />
That is to say, the path of the picture is the access path of the above php code, which is ok
If it is a picture If it is not displayed, it means ob_clean(); is not written. This method is to remove the cache and so on. If it is garbled, just write the above php code directly in front of the display method. Remember, this method is separate and should not be combined with it. Other methods are mixed together
Readers who are interested in more thinkPHP related content can check out the special topics of this site: "ThinkPHP Getting Started Tutorial", "ThinkPHP Common Methods Summary", "Smarty Template Basic Tutorial" and "PHP Template Technology Summary".
I hope this article will help you design PHP programs based on the ThinkPHP framework.
The above introduces the simple implementation method of thinkPHP31 verification code, including the content of thinkphp. I hope it will be helpful to friends who are interested in PHP tutorials.