我有三个页面,其中一个带有 HTML 表单(输入变量),并将变量发布到 linkslvl2.php 。在我的第三页中,我想使用 GET 函数并从 linkslvl2.php 中检索变量。当我单击该进程时,我希望它自动处理 linkslvl2 并打印 linkslvl3 语句。我对如何将变量传递给它感到困惑。
<!doctype html>
<html>
<head>
</head>
<body>
<h1 style="text-align:center;"> Super Hero</h1>
<form action="linklvltwo.php" method="post">
请输入姓名:
输入超级英雄名称:
输入你的弱点:
<!doctype html>
<html>
<head>
</head>
<body>
<?php
$name = $_POST['namep'];
$superHero = $_POST['superhero'];
$weakness = $_POST['weakness'];
?>
</body>
</html>
<!doctype html>
<html>
<head>
</head>
<body>
<?php
$person = $_GET['name'];
$chosenhero = $_GET['superHero'];
$chosenweakness = $_GET['weakness'];
print"
<p>$person you have chosen $chosenhero as you super hero, and your weakness $chosenweakness</p>
"
?>
</body>
</html>