您好,我对以下代码的所需输出有疑问。
我需要打印You hit T--
当我看到消息时Form 2 is here!
消息和按钮。
但现在发生的事情是当我点击T--
按钮时会出现消息,但Form 2 is here
按钮内容消失。我需要该消息在屏幕上可见,同时该消息You hit T--
prints.
有人可以强调一下如何纠正这个问题吗?非常感谢您的浏览
代码如下:
<DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<div id="one" style="width:300px; background:gray;">
<form method="post" action="<?= $_SERVER['PHP_SELF'] ?>">
<input type="text" name="txt1" id="txt1">
<?php
if(isset($_POST['sendone']))
{echo "<input type='submit' name='sendtwo' id='sendtwo' value='Two'>";}
?>
<input type="submit" name="sendone" id="sendone" value="One">
</form>
</div>
<div id="two" style="width:300px; background:yellow;">
<?php
if(isset($_POST['sendtwo']))
{echo "Form two is here!"; ?>
<form method="post" action="<?= $_SERVER['PHP_SELF'] ?>">
<?php echo "<input type='submit' name='sendt' id='sendt' value='T--'>";}
if(isset($_POST['sendt'])) {echo "You hit T--"; return;}
?>
</form>
</div>
</body>
</html>
如果我没猜错的话,基本上就是在发布以太币时打印该消息sendtwo or sendt.
if(isset($_POST['sendtwo']) || isset($_POST['sendt']))
{ echo "Form two is here!"; ?> }
这是一个example http://codepad.viper-7.com/DboJsS.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)