I want to have multiple forms on one page, however, I need to get the results of the form and keep those results for the remainder of the session. How do I do this? Right now I am just testing this which is why there is not much information on the page. When I select an item in my first box and hit the "Submit" button it works fine. The problem is when I click the "submit" button on one of other forms...I loose all my information. Any help will be greatly appreciated.
<?php require_once('Connections/Thor.php'); ?>
<?php
function get_ind_string($idx){ //This function will return the string value from my select box
switch ($idx) {
case "2":
return 'Electric';
break;
case "4":
return 'IT';
break;
case "6":
return 'Nat Gas';
break;
case "7":
return 'Other';
break;
case "8":
return 'Telecom';
break;
case "9":
return 'Wtr & WasteWtr';
break;}}
?>
<?php
$ckSubmit=$POST['ckSubmit']+1;//Here I am declaring variables that occur after the form has been posted
$ckSubmit1=$POST['ckSubmit1']+1;
$ckSubmit2=$_POST['ckSubmit2']+1;
echo $ckSubmit;
echo $ckSubmit1;
echo $ckSubmit2;
if($ckSubmit>1){
$industry = $_POST['selectIndustry'];
$ind = get_ind_string($industry);}
?>
<html>
<head>
<title>PROJECT OPENING REPORT</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<table width="631" height="143" border="0">
<tr>
<td width="332" height="137"><img src="intranet_01.jpg" name="Image1" width="300" height="50" id="Image1"><img src="intranet_03.jpg" name="Image2" width="300" height="50" id="Image2"></td>
<td width="283"> <div align="center">
<p><strong><font size="5">Project Opening Report</font></strong></p>
<p>
<input type="text" value="INDICATES REQUIRED FIELDS" style="width:80%; background:yellow" name="textfield">
</p>
</div></td>
</tr>
</table>
<form name="form1" method="POST" action="<?php echo $_SERVER['PHP_SELF']?>">
<input type="hidden" name="ckSubmit" value="<?php echo $ckSubmit; ?> ">
<?php if ($ckSubmit<2) {?>
<select name="selectIndustry" style="width:20%; background:yellow" size="1" id="selectIndustry">
<option value="2">Electric</option>
<option value="4">IT</option>
<option value="6">Natural Gas</option>
<option value="7">Other</option>
<option value="8">Telecom</option>
<option value="9">Wtr & WasteWtr</option>
</select>
<?php } else {?>
<input name="txtSelectIndustry" type="text" id="txtSelectIndustry" value="<?php echo $ind; $ckSubmit=3; ?>">
<?php }?>
<input type="submit" name="Submit" value="Submit" >
</form>
<form name="form2" method="POST" action="<?php echo
$_SERVER['PHP_SELF'];?>">
<input type="hidden" name="ckSubmit1" value="<?php echo $ckSubmit1; ?> ">
<input type="submit" name="Submit" value="Submit">
</form>
<form name="form3" method="POST" action="<?php echo $_SERVER['PHP_SELF'];?>">
<input type="hidden" name="ckSubmit2" value="<?php echo $ckSubmit2; ?> ">
<input type="submit" name="Submit" value="Submit">
</form>
<p> </p>
</body>
</html>