Here is an example of one compontent of the form. All forms work properly, so I don't think this is the problem. There are actually more fields, but this example should work.
<form method="POST" action="add_show_verify.php"><input type="hidden" name="PHPSESSID" value="dceb9a397ee97c6433c6881aac606f32" />
<table>
<tr>
<td width="12%"><b><font face="Verdana" size="2" color="#FFFFFF">Headliner</font></b></td>
<td width="88%"><font face="Verdana"><input type="text" name="band1" size="25"></font></td>
</tr>
<tr>
<td width="12%">Support Band</td>
<td width="88%"><font face="Verdana"><input type="text" name="band2" size="25"></font></td>
</tr>
</table>
The next script shows a verification of everything they entered. If it comes from the edit page. Basically what I try to do here is if the user comes from the edit page the band array is assigned from the session variable (the code is after this section). If the user comes from the previous form (the first time info was entered), the posted variables are assigned a local variable, and then the local variable is assigned to the session variable. This part works fine if the user is not trying to edit.
session_start();
header("Cache-control: private");
$source = $SESSION['source'];
if ($source =="edit") {
$band[0] = $SESSION['band0'];
$band[1] = $SESSION['band1'];
} else {
$band[0] = stripslashes($POST[band1]);
$band[1] = stripslashes($POST[band2]);
}
if ($source =="edit") {
//do nothing here. I could've written this part differently
} else {
$SESSION['band0'] = ucwords($band[0]);
$_SESSION['band1'] = ucwords($band[1]);
}
THis next part of code is from the edit page. First the user clicks on edit info and they are taken to a pre-filled form. The code below is executed once the are done editing and click submit. It then forwards them to the verification page. The problem is the verification page shows the old session values, and not the new ones.
<?
$band[0] = stripslashes($POST[band1]);
$band[1] = stripslashes($POST[band2]);
session_start();
header("Cache-control: private");
//erase old session variables, here are a few, but I do it for all variables and re post them even if unchanged
unset($SESSION['year']);
unset($SESSION['month']);
unset($SESSION['day']);
unset($SESSION['proper_date']);
unset($SESSION['cost']);
unset($SESSION['time']);
unset($SESSION['band0']);
unset($SESSION['band1']);
//set new session variables, the local variables come from the posted info.
$SESSION['year'] = $year;
$SESSION['month'] = $month;
$SESSION['day'] = $day;
$SESSION['proper_date'] = $proper_date;
$SESSION['cost'] = $cost;
$SESSION['time'] = $time;
$SESSION['band0'] = ucwords($band[0]);
$SESSION['band1'] = ucwords($band[1]);
//forward the user to the verification form which is shown above
header ("Location: add_show_verify.php");
exit;
?>
That's about the size of it. Seems to me the problem is the old session variables are not being overwritten by the new ones. Maybe I put too much code here, but any help is appreciated.
If you wanna try it out for yourself, go to http://www.letsgo77.com/shows/add_show_1.php Choose a city of Fresno, CA or Stockton CA, add two bands or more, then choose fix the info. Change one component and verify again. Please don't submit the info.
Cheers!
Jeff