
<?php
namespace Home\Controller;
use Think\Controller;
class IndexController extends Controller {
public function index(){
header("Content-Type:text/html; charset=utf-8");
$this->display("reg");
}
function add(){
if(md5($_POST['verify'])!=$_SESSION['verify']){
$this->error("验证码错误");
}
$user=D("User");
if($user->create()){
if($user->add()){
$this->success("注册成功");
}else{
$this->error("注册失败");
}
}else{
$this->error($user->getError());
}
}
function verify(){
import("ORG.Util.Image");
image::buildImageVerify(4,1,'gif',60,22,'verify');
}
}
最佳答案