I have a simple one-page program that takes input from a form, checks for missing values, and if missing values are present, prints a warning and stops( via an exit command). If you hit the back button, the input fields still hold the input , i.e. remain"sticky".
I use the exact logic on a four page program that takes input from a much longer form, looks for missing values, prints out warnings for missing values and stops via
the exit command. BUT....hitting the back button wipes out the input fields...
no "stickiness". The action attribute is the form page inself; the program both
precesses the input and presents the form.
My pseudo code is as follows:
<?php
if(submit detected)
{
foreach($_POST as $index=>$value)
{
if value missing, print warning;
exit;
}
perform INSERT queries;
perform INSERT queries;
}
else
{
present the form; //form requires an included file
}
?>
I'm baffled because in one context the code works fine but in another
it doesn't.