I'm going nuts over this one. Perhaps this is kludgy, but it has worked for
me before.
When I give the user a form, say AAA.php that has a few fields on it, and he
has to fill it out, I check for validity. If I find an error, I created a
session variable like:
$_SESSION['AnError'] = "Description of the error";
I then call the form again with
header("Location: ThisForm.php");
In the <body> area I have
<?php if (isset($_SESSION['AnError'])) echo $_SESSION['AnError']; ?>
Doing thing like this has worked before. Now, for a particular form when I
try it, it doesn't display. I tested it further with
<?php echo "Error: . $_SESSION['AnError']; ?>
and only the "Error: " displayed. This told me that the session variable
was not set. However, if I put echos in the code immediately after it gets
set, then it echos and prints further that the headers have already been set
(BTW, what does that mean?). So, I know that it is being set, it is not
being unset anywhere, yet it isn't set when the form redisplays.
I have been banging my head against the wall for hours now. Anyone have any
ideas?
Shelly