时间:2021-07-01 10:21:17 帮助过:14人阅读
if($_POST) {
$user = User::getByname($_POST['username']);
if($user->username == $_POST['username'] && $user->pwd== $_POST['pwd'])
....
先判断有没有点击登录
if(isset($_POST['submit'])){
if($user->username == $_POST['username'] && $user->pwd== $_POST['pwd']){
}
}
这样就不会出用户没值报错了