Home  >  Article  >  php教程  >  thinkPHP3.1验证码的简单实现方法,thinkphp3.1验证码

thinkPHP3.1验证码的简单实现方法,thinkphp3.1验证码

WBOY
WBOYOriginal
2016-06-13 08:41:191416browse

thinkPHP3.1验证码的简单实现方法,thinkphp3.1验证码

本文实例讲述了thinkPHP3.1验证码的简单实现方法。分享给大家供大家参考,具体如下:

代码中写:

public function verify(){
    import('ORG.Util.Image');
    ob_clean();
    Image::buildImageVerify();
}

html中写:



就是说图片的路径就是上面php代码的访问路径,就ok

如果是图片不显示,就是ob_clean();没有写,这个方法就是去除缓存之类的

如果是乱码就是直接把上面的php代码写在了display方法的前面,记住,这个方法是单独的,不要和其他方法混在一起

更多关于thinkPHP相关内容感兴趣的读者可查看本站专题:《ThinkPHP入门教程》、《ThinkPHP常用方法总结》、《smarty模板入门基础教程》及《PHP模板技术总结》。

希望本文所述对大家基于ThinkPHP框架的PHP程序设计有所帮助。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn