zoukankan      html  css  js  c++  java
  • ThinkPHP学习(五)图片验证码

    今天用到图片验证码的功能,在网上找到ThinkPHP的下面代码:

    	Public function verify(){
    		import('think.Image');
    		Image::buildImageVerify();
    	 }
    加入到Controller中,通过地址“http://localhost/index.php/passport/index/verify”来訪问,却提示下面错误:

    Class 'PassportControllerImage' not found


    我的ThinkPHP版本号是:3.2.1,经过查看相应版本号的文档“http://document.thinkphp.cn/manual_3_2.html#verify”,发现须要使用下面代码:

    	Public function verify(){
    		$Verify = new ThinkVerify();
    		$Verify->entry();
    	 }
    但刷新浏览之后又出错了“Call to undefined function Thinkimagecreate()”


    搜索之后发现是没有启用“extension=php_gd2.dll”扩展。在php.ini中去掉前边的分号; 再刷新浏览图片验证码就出来了。





  • 相关阅读:
    markdown常用语法
    利用 js-xlsx 实现选择 Excel 文件在页面显示
    HTML中meta标签
    wxpy模块
    Python基础(3)
    Python基础(2)
    Python基础(1)
    Python之递归锁与互斥锁
    Python进程与线程
    Docker
  • 原文地址:https://www.cnblogs.com/brucemengbm/p/6796739.html
Copyright © 2011-2022 走看看