验证码的实现1

<?php
    
//图像验证码生成
    function actionImgcode()
    {
        
$imgcode = & FLEA::getSingleton('FLEA_Helper_ImgCode');
        
/**
        * @param int $type 验证码包含的字符类型,0 - 数字、1 - 字母、其他值 - 数字和字母
        * @param int $length 验证码长度may
        * @param int $leftime 验证码有效时间(秒)
        * @param array $options 附加选项,可以指定字体、宽度和高度等参数,默认是GD库设置的字体
        
*/
        
$imgcode->image(2, 5);
    }
    
//图像验证码验证
    function actionImgCheck()
    {
        
$imgcode = & FLEA::getSingleton('FLEA_Helper_ImgCode');
        
if (!$imgcode->check($_POST['imgcode'])) {
            
echo "<font color=\"Red\">不正确或超时</font>";
        } 
else {
            
echo 'right';
        }
        
include('helper_imgcode.php');
    }
posted @ 2008-04-25 22:06 52Qin 阅读(33) 评论(0)  编辑 收藏 网摘

标题  
姓名  
主页
Email (博主才能看到) 
验证码 *  看不清,换一张 [登录][注册]
内容(请不要发表任何与政治相关的内容)  
  登录  使用高级评论  新用户注册  返回页首  恢复上次提交      
Google站内搜索

相关文章:

相关链接: