<html>
<head>
<title>展示验证码</title>
</head>
<body>
/*在模板html中,使用一个img标签,请求一个可以生成图像的SRC地址。 back/views/login.html   所请求的地址,还是一个控制器的动作方法!*/
/*在控制器中增加相应的动作
    back/AdminController->captchaAction()

    生成登录表单验证码
    public function captchaAction(){
        //调用验证码工具类,生成图像
        $t_captcha= new Captcha();
        $t_captcha->makeImage();
    }

    测试:需要将该动作,放到不需要校验的特例中

*/ 
<table>
<tr>
        <td align="right">
        <img width="145" height="20" border="1" title="看不清?点击更换验证码。" style="cursor:pointer;" onclick="" alt="CAPTCHA" src="index.php?p=back&c=Admin&a=captcha">    
        </td>
</tr>
</table>
</body>
</html

 

内容来源于网络如有侵权请私信删除
你还没有登录,请先登录注册
  • 还没有人评论,欢迎说说您的想法!