我们先建一个名为form_php.html的文件:
Code
<html>
<body>
<form action="welcome.php" method="post">
Your name:<input type="text" name="yourName"><br>
Your age: <input type="text" name="yourAge"><br>
<input type="submit">
</form>
</body>
</html>
然后建一个
welcom.php文件:
welcom.php
<html>
<body>
Welcom! <?php echo $_POST["yourName"]; ?>.<br/>
Your are <?php echo $_POST["yourAge"];?> years old.<br/>
</body>
</html>
传递表单变量的变量除了 $_GET, 还有 $_POST和$_REQUEST,而 $_REQUEST的功能包含了$_GET和$_POST