テキスト ボックスに名前を入力して次のページに移動するボタンをクリックすると、入力した名前が正しいかどうかを確認し、次のボタンをクリックして最後のページに移動する 3 つのページを作成しようとしています。 . 入力したテキストは、最初のページから 2 番目、3 番目のページに転送または通過する必要があります。コードでは、「非表示」、「ヘッダー」、および「POST」を使用する必要があります。
これまでのところ、1ページ目にあるものは次のとおりです。
<? $things = array('one thing', 'two thing'); ?>
<form action= "page1.php" method="POST">
<INPUT TYPE="TEXT" name="textbox">
<input type='hidden' name='secret' value=96>
<input type='hidden' name='stuff' value='<?= urlencode(serialize($things)) ?> ' >
<input type='submit' name='submit_btn'>
</form>
これは私が次のページで得たものです:
<?php
echo "Click next if your name is " . $_POST['textbox'];
?>
<form action= "page2.php" method="POST">
<input type='hidden' name='secret' value=96>
<input type='hidden' name='stuff' value='<?= urlencode(serialize($things)) ?> ' >
<input type='submit' name='next' value ="next">
</form>
そして、これは私が最後のページで得たものです...助けてください! ありがとう!
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
</head>
<body>
<form action= "page1.php" method="POST">
<?php
echo "Finally! Welcome " . $_POST['textbox'];
?>
</form>
</body>
</html>