I having trouble accessing form values when I use the same page to display and process form data. I setup a basic example below, hopefully someone can see what I'm missing. When I run this script, the value of test is not returned. If I change the "action" parameter to a differnt page, the value of test is displayed.
Any suggestions?
Thanks,
Andrew
andrew_pasetti@harvard.edu
<?PHP
if (!isset($Submit)):
ShowForm1();
else:
ShowForm2();
endif;
function ShowForm1() {
print"
<form name=\"form1\" method=\"post\" action=\"\">
<input type=\"text\" name=\"test\">
<input type=\"submit\" name=\"Submit\" value=\"Submit\">
</form>
";
} # End Function ShowForm1
function ShowForm2() {
echo $test;
} # End Function ShowForm2
?>