一个简单的登录判断下post过来的用户名username和密码pwd否相同$user = User::getByname(username);//查询到的时候为空会报错
if($user->username == $_POST['username'] && $user->pwd== $_POST['pwd'])

if(isset($user->username))//这样没事但我想实现上面那个登录判断下post过来的用户名username和密码pwd否相同的逻辑请问该怎样解决,不要说@了