<?php
//Section 2
Function S2Q1(){
global $question1;
global $S1Q1;
global $S1Q2;
global $PHP_SELF;
?>
<form name="form1" method="post" action="<?php echo $PHP_SELF; ?>">
Section 2 <input type="text" name="question2">
<input type="hidden" name="S1Q1" value="<?php echo htmlspecialchars($S1Q1); ?>">
<input type="hidden" name="S1Q2" value="<?php echo htmlspecialchars($S1Q2); ?>">
<?php
while (list($k, $v) = each($_POST))
{
print("<input type=hidden name=\"$k\" value=\"".htmlspecialchars($v)."\">\n");
}
?>
<input type="submit" name="Submit" value="Submit">
<input type="hidden" name="stage" value="3">
</form>
<?php
}
?>
I am using switch to decided which fucntions to display:
<?php
// Determine the sections to diplay
switch ($stage) {
case "2":
if ($S1Q1 == "No"){
S3Q1();
}
else {
S2Q1();
and so on...
So why wont this bit of code work:
<?php
while (list($k, $v) = each($_POST))
{
print("<input type=hidden name=\"$k\" value=\"".htmlspecialchars($v)."\">\n");
}
?>
If i put the $_POST in the switch, like this:
switch ($_POST['stage']) {
Then the switch will not work.
HELP ME PLEASE!!!