【发布时间】:2021-10-05 16:24:09
【问题描述】:
对此有点新意,所以如果我的问题经常被问到或者没有任何意义,我很抱歉。我试图让 PHP 将用户的输入回显到屏幕上的表单。每当我测试表格时,什么都没有改变。您对这个问题有什么看法?
<body>
<script src="index.js"></script>
</body>
</html>
<center><form name="name" method="get" class="form" id="nameInput">
<center><h4>Name</h4></class></center>
<center><input>
<center><div><form name="post" method="get" class="form" id="postInput">
<center><h4>Post</h4>
<center><input></div>
<center><div><button id="postButton">Post</button></div>
<?php
if(empty($_GET['name']) && empty($_GET['post'])){
echo "<h3>test</h3>";
$name = $_GET['name'];
$post = $_GET['post'];
}else{
$name = $_GET['name'];
$post = $_GET['post'];
echo "<h3> User: $name </h3>";
echo "<h3> Post: $post </h3>";
}
?>
【问题讨论】:
-
你可能想看看在某个时候添加一些
</form>标签???? -
你应该退后一步,先学习如何正确编写 HTML,你缺少结束标签、输入名称、按钮类型等。