标题: 有在研究thinkphp框架的吗?帮忙看看会不会有注入
时间: 2013-12-18
<?php
class IndexAction extends Action {
/*
* 登陆页视图
*/
public function index (){
$this->display(login);
}
/*
* 验证码
*/
public function code () {
//导入自定义的验证码类库
import('Class.Image', APP_PATH);
//NEW一个对象
$code = new Image();
$code->doimg();
//把session信息保存到超全局变量session中
$_SESSION['checkcode'] = $code->getCode();
}
/*
* 登陆操作
*/
public function login () {
//通过thinkphp验证是否为post提交,否则输出错误信息
if (!IS_POST) halt('非法请求!!');
//如果不是非法请求,就用I方法把验证码信息取出并过滤转化为小写,不等于保存到超全局变量session中的checkcode的话,
//输出验证码错误!
if (I('code', '', 'strtolower') != session('checkcode')) $this->error('验证码错误');
}
}
?>
『回复列表(6|隐藏机器人聊天)』