有一句条件不会写。
$username=trim($_POST['username']);
$password=trim(&_POST['pass']);
//declare the SQL statement that will query the database
$query = "select top 6 * from WEB_VIEW  where DNBH='$username' order by SFMonth desc ";//execute the SQL query and return records
$result = mssql_query($query) or die ("查询数据失败: ".mysql_error());$numRows = mssql_num_rows($result); 
$nRow=mssql_fetch_array($result);
if (empty($numRows)&&$password <>substr(row[3], -4) ) {echo "<h2>没有查到数据哦,请正确输入用户名和密码。谢谢!</h2>";}
else {
  //输出结果
}empty($numRows)&&$password <> substr(row[1].lenth-3,4) 我的意思是 ,当查询结果为空 或者 用户输入的密码和数据库中的row[1] 最后 4个字符对比,如果不对,就输出错误提示,让用户再次输入用户名和密码 .  
运行时提示出错,Parse error: syntax error, unexpected '[' in D:\WWW\test.php