<?php
//过滤HTML
$skill = htmlspecialchars($_POST['skill']);
$xb = htmlspecialchars($_POST['sex']);
$nl = htmlspecialchars($_POST['age']);
$xl = htmlspecialchars($_POST['xueli']);
$gb = htmlspecialchars($_POST['ganbu']);
$pl = htmlspecialchars($_POST['ydpl']);
$ah = $_POST['like'];
$jz = htmlspecialchars($_POST['jz']);
if (empty($skill) || empty($xb) || empty($nl) || empty($xl) || empty($gb) || empty($pl) || empty($jz)) {
echo "填写不完整,请检查后重新提交!<br/><a href='javascript:history.back(-1)'>返回操作</a>";
exit();
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="main.css">
</head>
<body>
<form action="userinfo.php" method="post" enctype="multipart/form-data">
<div class="card">
<div class="card-header">大学生基本情况问卷调查</div>
<div class="card-content">
<div>性别:<?= $xb; ?></div>
<div>年龄:<?= $nl; ?>
</div>
<div>学历:<?= $xl; ?></div>
<div>专业:<?= $skill; ?></div>
<div>是否学生干部:<?= $gb; ?></div>
<div>兴趣爱好:
<?php
foreach ($ah as $v) {
//过滤HTML后输出
echo htmlspecialchars($v) . ' ';
}
?>
</div>
<div>阅读频率:<?= $pl; ?></div>
<div>是否兼职:<?= $jz; ?></div>
</div>
</div>
</form>
</body>
</html>