<?php
session_start();
include('../../includes/header.php');
if (!isset($_GET['step'])) {$_SESSION['num'] = 0;}
if (isset($_GET['step'])) {$_SESSION['num']++;}
if ($_SESSION['num'] > 2) {$_SESSION['num'] = 0;}
if (isset($_GET['textinsert'])) {$_GET[$_SESSION['num']] = $_GET['textinsert'];}
?>
<form>
<label for="toinsert">New Array Value?:</label><br>
<input type="hidden" name="1" value="<?php isset($_GET['textinsert']) ? $_GET['textinsert'] : ""; ?>">
<input type="hidden" name="2" value="<?php isset($_GET['2']) ? $_GET['2'] : ""; ?>">
<input type="text" id="toinsert" name="textinsert" value=""><br>
<input type="submit" value="Insert?">
</form>
<form>
<input type="hidden" name="1" value="<?php isset($_GET['1']) ? $_GET['1'] : ""; ?>">
<input type="hidden" name="step" value="0">
<input type="submit" value="Next">
</form>
<?php
$thenumber = $_SESSION['num'];
if (isset($_GET['textinsert'])) {$thestring = $_GET['textinsert']; echo("<h3>Array Value $thenumber = $thestring</h3>");}
include('../../includes/footer.php');
?>