作业要求:
登录页面(tload.php):
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
</head>
<body>
<!-- <?php echo "Hello World!" ?> -->
<form action="welcometable.php" method="get">
<!--一定要写name属性,否则服务器接收不到 -->
用户名:<input type="text" name="user">
数字:<input type="text" name="number">
<input type="submit" value="提交">
</form>
</body>
</html>
响应界面(welcometable):
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>welcome1</title>
</head>
<body>
欢迎<?php echo $_GET["user"]; ?>!<br>
数字是 <?php echo $_GET["number"]; ?> 。<br>
<?php
$temp = $_GET["number"];
echo
"<table border='1' id='tab'>";
echo "<tr>";
for ($i = 0; $i < 5; $i++) {
$t = $temp + $i;
echo "<td>$t</td>";
}
echo "</tr>";
echo "<tr>";
for ($i = 5; $i < 10; $i++) {
$t = $temp + $i;
echo "<td>$t</td>";
}
echo "</tr>";
echo "</table>";
?>
</body>
</html>