您应该使用隐藏字段。在第 1 页中,假设 2 有 2 个字段,在第 2 页中,您还有其他 2 个字段,但实际上您有 4:2 个可见,2 个隐藏。这些隐藏字段必须具有以下值:$_POST['field1']
示例:Page1.php:
<form action="page2.php" method="POST">
<input type="text" name="one">
<input type="submit">
</form>
page2.php:
<form action="page3.php" method="POST">
<input type="hidden" name="one" value="<?php echo $_POST['one']; ?>">
<input type="text" name="two">
<input type="text" name="three">
<input type="submit">
page3.php:
<form action="end.php" method="POST">
<input type="hidden" name="one" value="<?php echo $_POST['one']; ?>">
<input type="hidden" name="two" value="<?php echo $_POST['two']; ?>">
<input type="hidden" name="three" value="<?php echo $_POST['three']; ?>">
<input type="text" name="four">
<input type="submit">
</form>
结束.php
<?php
echo $_POST['one'];
echo $_POST['two'];
echo $_POST['three'];
echo $_POST['four'];
?>
http://www.echocho.com/htmlforms07.htm
http://www.tizag.com/htmlT/htmlhidden.php
php中的隐藏字段