Any suggestions how to keep the PHP variables in the form when the back button is used?
Here is a small portion of the info.php file
Code: Select all
<form method="post" action="confirm.php">
<div class="mediumtext1"><strong>Viewing Communities </strong></div>
<div class="note">Please specify where you want the notice shown.</div>
<br>
<label for="coudersport"> Coudersport
<input id="coudersport" name="coudersport" type="checkbox">
</label>
<label for="emporium"> Emporium
<input id="emporium" name="emporium" type="checkbox">
</label>
<label for="port"> Port Allegany
<input id="port" name="port" type="checkbox">
</label>
<input type="submit" name="Submit" value="Submit">
</form>Code: Select all
<form action="edit.php" method="post">
<? if(($coudersport != "") && ($emporium == "") && ($port == ""))
{ $where = "Coudersport";}
else if(($coudersport != "") && ($emporium != "") && ($port != ""))
{ $where = "All Communities";}
else if (($coudersport != "") && ($emporium != "") && ($port == ""))
{ $where = "Coudersport and Emporium";}
else if (($coudersport != "") && ($emporium == "") && ($port != ""))
{ $where = "Coudersport and Port Allegany"; }
else if (($coudersport == "") && ($emporium != "") && ($port == ""))
{ $where = "Emporium";}
else if (($coudersport == "") && ($emporium != "") && ($port != ""))
{ $where = "Emporium and Port Allegany";}
else if (($coudersport == "") && ($emporium == "") && ($port != ""))
{ $where = "Port Allegany"; }
?>
You have chosen to have the notice appear in <? print ($where); ?>
<input type="hidden" name="where" value="<? print($where);?>" />
<input type="submit" name="Submit" value="Edit">
</form>Here is the edit.php file
Code: Select all
<form method="post" action="confirm.php">
<div class="mediumtext1"><strong>Viewing Communities </strong></div>
<br>
You have indicated that your message or ad should be shown in <strong><?print($where);{?></strong>. <br>
If you want to make a change to the viewing communities, please make a new selection below.
<br><br>
<!-- code that prints the 'x' in the checkbox of the community selected. If AllTowns is checked, or if all 3 communities are checked, only the AllTowns box will have the 'x' -->
<label for="coudy"> Coudersport
<input id="coudy" name="coudy" type="checkbox">
</label>
<label for="emp"> Emporium
<input id="emp" name="emp" type="checkbox">
</label>
<label for="portA"> Port Allegany
<input id="portA" name="portA" type="checkbox">
</label>
<?
if(($coudy != "") && ($emp =="") && ($portA == ""))
{$where = "Coudersport";}
elseif (($coudy != "") && ($emp == "") && ($portA != ""))
{ $where = "Coudersport and Port Allegany"; }
elseif (($coudy == "") && ($emp != "") && ($portA == ""))
{ $where = "Emporium";}
elseif (($coudy == "") && ($emp != "") && ($portA != ""))
{ $where = "Emporium and Port Allegany";}
elseif (($coudy == "") && ($emp == "") && ($portA != ""))
{ $where = "Port Allegany"; }
elseif(($coudy != "") && ($emp != "") && ($portA != ""))
{ $where = "All Communities";}
elseif (($coudy != "") && ($emp != "") && ($portA == ""))
{ $where = "Coudersport and Emporium";}
?>
<input type="hidden" name="where" value="<? print($where);}?>" />
<input type="submit" name="Submit" value="Submit Change">
</form>