CSS 样式表
css
body {font-family: Arial, Helvetica, sans-serif;font-size: 16px;margin: 0;padding: 0;
}.wrapper {width: 100%;height: 100vh;display: flex;flex-direction: column;align-items: center;justify-content: center;
}header {width: 100%;height: 60px;background-color: 333;color: fff;text-align: center;line-height: 60px;
}main {width: 500px;max-width: 100%;margin: 0 auto;padding: 20px;background-color: f5f5f5;
}form {display: flex;flex-direction: column;gap: 10px;
}label {margin-right: 10px;
}input {width: 100%;padding: 10px;border: 1px solid ccc;border-radius: 5px;
}.error {color: ff0000;
}footer {width: 100%;height: 60px;background-color: 333;color: fff;text-align: center;line-height: 60px;
}PHP 查询脚本
php
alert('验证码错误!');";exit;
}// 查找成绩记录
$sql = "SELECT FROM student_score WHERE name='$name' AND id_number='$id_number'";
$result = mysqli_query($con, $sql);// 如果没有找到记录,提示错误
if (mysqli_num_rows($result) == 0) {echo "
";exit;
}// 获取成绩记录
$row = mysqli_fetch_assoc($result);// 输出成绩
echo "姓名:{$row['name']}
";
echo "准考证号:{$row['id_number']}
";
echo "总分:{$row['total_score']}
";