Conditions:
Register globals is set to on.
Parse html as php is set to on.
I have two forms OrderTest1 and OrderTest2 and need to be able to validate
the data from OrderTest1 before passing to OrderTest2. The first block of
code below is the first form. This form calls itself and does perform the
validations correctly as I want. However, once the header redirect to
OrderTest2.htm is performed after the isset($POST['submit'])) evaluates as
true indicating the values have been posted, I'm redirected to
OrderTest2.htm but the values entered do not display. Why?
If the redirect eliminates the posted variables, how can I perform a
validation within a form that posts to itself then pass posted values to a
second form? Obviously the values are not passed even though they should be
global variables at this point. How can I successfully pass values posted to
the first form to the second form after the header location command is
called?
Help!
================================================== ===
OrderTest1.htm
================================================== ===
<?php
if(isset($_POST['submit']))
{
$successflag="true";
if ((trim($fullname)=="") && isset($fullname))
{
$successflag="false";
}
if($successflag=="true")
{
Header("location: OrderTest2.htm");
exit;
}
}
?>
<!--************************************************** ***************-->
<!--************************************************** ***************-->
<!--************************************************** ***************-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<form method="post" action="<?php $server['PHP_SELF']?>">
<b>fullname:</b> <input type="text" name="fullname" size="49">
</body>
</html>
================================================== ===
OrderTest2.htm
================================================== ===
<?php
echo "Test";
echo $_POST['fullname'];
echo $HTTP_POST_VARS['fullname'];
?>
<html>
<head>
</head>
<body>
<p> </p>
</body>
</html>