One way to do it is by using a "bounce" page to reflect information back to the orginal page, via GET or POST. Let me give you an example:
Page1.php has the following information:
<?php
$select1=$GET['select1'];
$return="http://".$SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
echo "
<form method='get' action='/php/bounce.php'>
<input type='hidden' name='return' value=$return'>
<select name='select1'>
<option value='option1'>Option 1</option>
";
if ($select1=="option2")
{
echo "<option value='option2' selected>Option 2</option>";
}
else
{
echo "<option value='option2'> Option 2</option>";
}
echo "
</select>
<input type='submit' value='Change'>
</form>
";
switch($select1)
{
case "option1":
echo "
<form method='post' action='/php/Finish.php'>
<select name='select2'>";
<option value='option3'>Option 3</option>
<option value='option4'>Option 4</option>
</select>
<input type='submit' value='Submit'>
</form>
";
break;
case "option2":
echo "
<form method='post' action='/php/Finish.php'>
<select name='select2'>";
<option value='option5'>Option 5</option>
<option value='option6'>Option 6</option>
</select>
<input type='submit' value='Submit'>
</form>
";
break;
default:
echo "Please Select an option above to continue";
break;
}
?>
Then, bounce.php is a page that simply grabs the return path and appends configuration information on the end...
<?php
$return=$GET['return'];
$select1=$GET['select1'];
$back=$return."?select1=".$select1;
echo "
<meta http-equiv='refresh' content=0;URL='$back'>
";
?>
Granted, this isn't an elegant solution, but it works...