PHP表单不适合我


PHP form is not working for me

我正在制作一个非常简单的钓鱼游戏。用户自己买锅,够简单的。
现在购买花盆的表单看起来非常简单

title1 - box1 - submit_buttom1
title2 - box2 - submit_buttom2

现在,当用户在box1中输入信息,然后点击键盘上的"enter"键时,submit_button1被激活,脚本运行。
但当用户在box2中输入信息并点击键盘上的"enter"键时,submit_button1被激活。
现在我能理解为什么这听起来很混乱所以我把它放到网上了

链接

这是我的脚本

 echo "<table border='"0'" cellspacing='"3'" cellpadding='"3'" >'n";
 echo "<form method='"post'" action='"index.php'">'n";
 echo "<tr><td>North Pot</td><td><input type='"text'" name='"northpot'"></td>'n";
 echo "<td colspan='"2'" align='"center'"><input type='"submit1'" name='"submit1'" value='"Buy'"></td></tr>'n";
 echo "</forum></table>";
 echo "<table border='"0'" cellspacing='"3'" cellpadding='"3'" >'n";
 echo "<form method='"post'" action='"index.php'">'n";
 echo "<tr><td>South Pot</td><td><input type='"text'" name='"southpot'"></td>'n";
 echo "<td colspan='"2'" align='"center'"><input type='"submit2'" name='"submit2'" value='"Buy'"></td></tr>'n";
 echo "</forum></table>";

如果您需要更多的信息,请告诉我

您应该将</forum>更改为</form>

正在生成无效的HTML。表单不能是<table>的子元素,也不能是<tr>的父元素。它也拼写为form而不是forum

很可能您的浏览器正在通过将表单元素移动到表之后的而将所有表单控件留在表内来恢复此错误。

使用验证器

您的关闭表单,标签拼写论坛。应该是</form>