<?php
namespace Home\Controller;
use Think\Controller;
class UserController extends Controller {
public function index(){
$this->display();
}
public function login(){
//$_GET $_POST
$data = I('post.');
$msg = '用户名输入正确';
if($data['username'] == 'admin' && $data['userpwd'] == 'admin'){
$this->show($msg);
}else{
$this->show('输入的不对');
}
}
public function register(){
//$_GET $_POST
$data = I('post.');
$msg = '用户名输入正确';
if($data['username'] == 'admin' && $data['userpwd'] == 'admin'){
$this->show($msg);
}else{
$this->show('输入的不对');
}
}
} <meta http-equiv="Content-Type" Content="text/html;charset=utf-8" />
<body>
<form action="{:U('Home/User/register')}" method="post">
用户名:<input type="text" name="username">
密码: <input type="password" name="userpwd">
<input type="submit">
</form>
</body>大家看下register函数有错吗,为什么不能正常运行,运行后直接跳过html页面直接显示结果 最佳答案