请用户在输入dosen&t输入的值在PHP中显示。这是代码
<html>
<head></head>
<form method="post" action="hiUser.php">
Please type your name
<input type="text" name="u" value="">
<input type="submit">
</form>
</body>
</html>
这是php代码
<html>
<body>
<h3> hi user, </h3>
<?
echo $_ POST['u']
Print $u
?>
</body>
</html>
答案 0 :(得分:1)
form.php的
<html>
<head></head>
<form method="post" action="hiUser.php">
Please type your name
<input type="text" name="u" value="">
<input type="submit">
</form>
</body>
</html>
hiUser.php
<html>
<body>
<h3> hi user, </h3>
<?php
echo $u = $_POST['u'] ;
?>
</body>
</html>
答案 1 :(得分:0)
如果您尚未启用short_open_tags
<? echo $_ POST['u']
Print $u
?>
必须像这样
<?php $u = $_POST['u'];
echo $u;
?>