rss· 投稿· 设为首页· 加入收藏· 繁體版
当前位置: 火魔网 » 程序开发 » PHP

CodeIgniter 验证码的使用

<?php
        /**
         *   CodeIgniter 验证码的使用
         *   这里面 img_path,img_url 是必填的,其它的选填
         */
        $vals = array(
           // 'word' => 'Random word',  // 传入自定义的随机码
            'img_path' => './upload/',
            'img_url' => 'http://ci.test/t1/upload/',
            'font_path' => './f/Starstruck.ttf',
            'img_width' => '150',
            'img_height' => 30,
            'expiration' => 7200
            );
        
        $cap = create_captcha($vals);
        //echo $cap['word'];  // 这个是生成的验证码
        echo $cap['image'];
?>

顶一下
(0)
踩一下
(1)