用户
 找回密码
 入住 CI 中国社区
搜索
查看: 2619|回复: 2
收起左侧

[HELP] ci验证码不能显示 之前在论坛搜了没找到答案

[复制链接]
发表于 2012-8-17 09:40:14 | 显示全部楼层 |阅读模式
ci验证码不能显示 之前在论坛搜了没找到答案
szq_captcha.php文件代码
PHP复制代码
 
 
<?php
/*
*
*    CI框架辅助函数之验证码辅助函数
*/

    class Szq_captcha extends CI_Controller
    {
        function __construct()
        {
            parent::__construct();
 
        }
 
        function index()
        {
           
          $this->load->helper('captcha');
          $vals = array(
            'word' => 'Random word',
            'img_path' => './backup/',
            'img_url' => 'http://localhost/aqzf_ci/index.php/szq_captcha/',
            'font_path' => './path/to/fonts/texb.ttf',
            'img_width' => '150',
            'img_height' => 30,
            'expiration' => 7200
            );
            $cap = create_captcha($vals);
            $data = array('captcha_time' => $cap['time'],
                        'ip_address' => $this -> input -> ip_address(),
                        'word' => $cap['word']
                        );
              var_dump($cap);
            return  isset($cap['image'])?$cap['image']:'Agin,Please refresh. ';
 
        }
    }
?>
 
复制代码





发表于 2012-8-22 23:45:51 | 显示全部楼层
看手册
发表于 2012-11-9 17:41:18 | 显示全部楼层
我倒是能显示,就是不知道显示了,到后台怎么验证,CI的验证码手册上定义的一个常量, 但是验证码不可能是这一个吧,我是不用数据库的那个CI。

本版积分规则