Hi - my first posting; but I've been lurking for many months!
I've also posted this to the alt.php newsgroup - but no help yet.....
I'm stripped down a program that was giving me problems. so we now
just have some forms with test output at the top. I know it doesn't
seem to do anything as it is!
<HEAD>
<TITLE>Form test page - DQ 14/2/2001</TITLE>
</HEAD>
<body topmargin=0 leftmargin=0 marginheight=0 marginwidth=0
bgcolor=#1D2868>
<?php
echo
"formaction=$formaction<br>form1=$form1<br>clearskw=$clearskw<br>form1b=$form1b<br>form2=$form2<br>form3=$form3<br>form4=$form4<br>form5=$form5<br><br>";
echo "<FORM method=post action =\"$PHP_SELF\">";
echo "<INPUT TYPE=TEXT NAME=form1 size=20 maxlength=20
value=$form1><br>";
echo "<INPUT TYPE=submit value=\"Continue\">";
echo "<INPUT TYPE=submit VALUE=\"Start again\"
NAME=\"clearskw\"</FORM><br><br>";
echo "<FORM method=post action =\"$PHP_SELF\">";
echo "<INPUT TYPE=TEXT NAME=form1b size=20 maxlength=20
value=$form1b><br>";
echo "<INPUT TYPE=submit value=\"Continue\">";
echo "<INPUT TYPE=submit VALUE=\"Start again\"
NAME=\"clearskw\"</FORM><br><br>";
echo "<form method=post action=\"$PHP_SELF\">";
echo "<input type =hidden name=formaction value=form2val>";
echo "<input type =submit value=submit2value></form>";
echo "<form method=post action=\"$PHP_SELF\">";
echo "<input type =hidden name=formaction value=form3val>";
echo "<input type =submit value=submit3value></form>";
echo "<form method=post action=\"$PHP_SELF\">";
echo "<input type =hidden name=formaction value=form4val>";
echo "<input type =submit value=submit4value></form>";
echo "<form method=post action=\"$PHP_SELF\">";
echo "<input type =hidden name=formaction value=form5val>";
echo "<input type =submit value=submit5value></form>";
?>
</BODY>
If I enter stuff into either or both of the textboxes, and press
either of the "continue" or "start again" submit buttons - I get the
result I want (i.e. the data is retained). However, mysteriously,
$formaction is set to "form2action" - even though that button is not
pressed.
If I press "submit2value" - that's okay too - and $formaction has the
value I would expect.
However, if I press any of the other buttons, further down the page -
"submit3value" or "submit4value" or submit5value" - the data in the
textboxes is lost.
Why?
What am I doing wrong? It's probably something obvious...
Thanks