ユーザーに自分の名前をテキスト ボックスに入力してもらい、各ページ (スイッチとケースの一部) に出力させようとしています。
default:
$message = "Enter your name and click start.";
$nextDecision = "
<form action=\"index.php\" method=\"POST\">
<input type=\"text\" name=\"input_value\">
<input type=\"submit\" value=\"Start\" name=\"submit\" />
</form>";
if (isset($_POST['submit']))
{
// Execute this code if the submit button is pressed.
$name = $_POST['input_value'];
$message = "message";
$nextDecision = "<form action=\"index.php\" method=\"get\">
<input type=\"radio\" name=\"choice\" value=\"back\">choice<br>
<input type=\"submit\">
</form>";
}
break;
私の index.php ページでは、ユーザーが送信を押して if ステートメントの外の別のケースに移動するまで、名前を出力します。if ステートメントの外で変数を渡す方法はありますか?