$sql = "select username from userInfo where username = '接收到的密码' and password = '接收到的密码'";$res = mysql_query($sql);$row = mysql_fetch_array($res);if($_POST['username'] == $row['username']) { //$_POST['username'] 为接收到的用户输入输入的用户名 echo '登陆成功';} else { echo '登陆失败';}