【发布时间】:2016-05-01 05:10:31
【问题描述】:
我刚开始学习 php 和 html,我想做一些可以输入并用 php 代码打印输出的东西。但是,使用我拥有的代码,它可以让我输入,但在我单击提交时不会打印任何内容。为什么?
<html>
<head><title>Noob</title></head>
<body>
<form action="" method="post">
<input type="text" name="username" value="" />
<input type="submit" name="submit value="Submit" />
</form>
<?php
if (isset($_POST['submit'])) { //to check if the form was submitted
$username= $_POST['username'];
echo $username;
}
?>
</body>
<html>
【问题讨论】: