Hi Aaron,
Thought it simplest to try the hidden-field method first - no new methods here.
Here's a draft of the srv.awd page ... I've put some comments in for explanation, but see how you get ...
<?php
// Def Constant
define( 'parentFile' , 1 );
include('common.php');
// Clean data input
if (get_magic_quotes_gpc()){
$_GET = array_map('stripslashes', $_GET);
$_POST = array_map('stripslashes', $_POST);
$_COOKIE = array_map('stripslashes', $_COOKIE);
}
// We'll use these to keep the hidden fields up to date
// I'm assuming here that an incomplete form will NOT be sent here
$GLOBALS['contact_fields'] = array('Name', 'Phone', 'Email', 'Unit', 'Deployed', 'Locale', 'Authorized', 'AppRank', 'AppPosition');
if(isset($_POST['peoplereg'])){
// Set stepnum to 1
$_POST['stepnum'] = 1;
} else {
$_POST['stepnum']++;
}
//Get count of all available items - Item A, Item B...
$itemCount = getItemCount(); //
//On the last step, the form should post to insert page (that page will send to thankyou)
if($_POST['stepnum'] == $itemCount){
$frmaction = "insertsrv.awd";
} else {
$frmaction = "srv.awd";
}
?>
<link rel="stylesheet" type="text/css" href="style.css" />
<style type="text/css">
.errFld {border: 1px solid #F00; }
.errMsg { color: #C33; }
</style>
<script type="text/javascript" src="wforms.js"></script>
<div id="soldier_left"></div>
<div id="soldier_right"></div>
<div>
<div class="headr">
<img src="images/headr.png" /><br>
</div>
<div class="container">
<div class="bodyDiv">
<div class="w745">
<div class="txtDiv">
<div class="survTitleDiv">
<p class="survTitle">Item #<?php echo $_POST['stepnum']?> - <b><?php echo getItemName($_POST['stepnum']); ?></b></p>
</div>
<div class="survcontent"><div class="content">
<form method="post" action="<?php echo $frmaction; ?>">
<input type="hidden" name="stepnum" value="<?php echo $_POST['stepnum']; ?>">
<?php
foreach($GLOBALS['contact_fields'] as $field_name){
// Here we use the array to echo out all the contact details in hidden fields
?>
<input type="hidden" name="<?php echo $field_name; ?>" value="<?php echo $_POST[$field_name]; ?>">
<?php
}
if($_POST['stepnum'] > 1){
// Here we print out all previous answers
for($i = 1; $i <= $_POST['stepnum']; $i++){
?>
<input type="hidden" name="disposition_<?php echo $i; ?>" value="<?php echo $_POST['disposition_'.$i]; ?>">
<input type="hidden" name="band_<?php echo $i; ?>" value="<?php echo $_POST['band_'.$i]; ?>">
<?php
}
?>
<div class="imgHold"><img src="<?php echo getItemImg($_POST['stepnum']); ?>"/></div>
<br />
<div class="desc"><b>Description:</b><br /><?php echo getItemDesc($_POST['stepnum']); ?></div>
<br />
<b>Choose your disposition:</b><br />
<select name="disposition_<?php echo $_POST['stepnum']; ?>" class="validate-integer required btn">
<option selected="selected" value="X">Select one...</option>
<option value="1" class="switch-a">AP (Acquisition Program)</option>
<option value="2" class="switch-a">Sustain</option>
<option value="3">Terminate</option>
<option value="4">No Response</option>
</select>
<div class="itemchoice-E" id="itemchoice-E"></div>
<div class="offstate-a">
<b>Please choose a retention band:</b>
<br />
<select name="band_<?php echo $_POST['stepnum']; ?>" class="validate-integer required btn">
<option selected="selected" value="X">Select One...</option>
<option value="1">Top Third: Must retain</option>
<option value="2">Middle Third: A good choice for retention</option>
<option value="3">Bottom Third: Optional choice for retention</option>
</select>
</div>
<div class="band-E"></div>
<br />
<span id="submitbutton" class="subbtn"><input class="next" type="submit" name="basicsurveysubmit" value="Next >"></span>
</form>
</div></div>
<div class="footr" align='center'><img src='images/awd_100.png' /></div>
</div></div>
</div>
</div>
<?php
echo '<div class="dateDiv"><div class="date">';
echo "Asymmetric Warfare Division (AWD)<br>Army Capabilities Integration Center (ARCIC) TRADOC<br>92 Patch Road, Bldg 270<br>Fort Monroe, VA 23651<br>";
echo date(DATE_COOKIE);
//echo date('l jS \of F Y h:i:s A') . " UTC";
echo '</div></div>';
?>
</div>
Then, here's a draft insertsrv.awd page (no MySQL here, but we can finish this bit later.
<?php
// Do all of the MySQL insertions in this page
// But before you even start on that code, check that ALL the data
// is been collected correctly
echo '<pre>'; var_dump($_POST); echo '</pre>';
// Afterwards, head off to ...
header('Location: thankyou.awd');
?>
See how you get on with this. There weel could be typo's in here but I think the logic's correct - haven't got enough time to test it with your data.
Paul
PS. What kind of site is this again - lookks a buit scary :xbones: