我正在尝试打印页面上的用户名文本框的值,这是我的代码,因为我知道这应该工作。我似乎得到一个名为Use of undefined constant的错误。
<html>
<head></head>
<body>
<form method = "post" action = "index.php">
Username:<input type = "text" name = "username">
<br>
<input type = "Submit" name = "Submit1">
<?php
$username1 = $_POST['username'];
print username1;
?>
</form>
</body>
</html>
答案 0 :(得分:2)
username1
应为$username1
答案 1 :(得分:1)
替换
print username1;
与
print $username1;