<html><head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<meta name="author" content=""><title>Untitled 2</title>
</head>
<body>
<form action="res.php" method="post"><input type="text" id="txt_fname">
<input type="submit" value="query">
</form>
</body></html>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<meta name="author" content=""><title>Untitled 2</title>
</head>
<body>
<form action="res.php" method="post"><input type="text" id="txt_fname">
<input type="submit" value="query">
</form>
</body></html>
index.php:<html><head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<meta name="author" content=""><title>Untitled 2</title>
</head>
<body>
<!--------------------------------------->
<form action="res.php" method="post">
<input type="text" name="txt_fname">
<input type="submit" value="query"></body>
</form>
</html>res.php:接收表单
<?php
//$name=$HTTP_POST_VARS["txt_fname"];
$name=$_POST['txt_fname'];
echo $name;
?>
index.php:<html><head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<meta name="author" content=""><title>Untitled 2</title>
</head>
<body>
<!--------------------------------------->
<form action="res.php" method="post">
<input type="text" name="txt_fname">
<input type="submit" value="query">
</form>
</body>
</html>res.php:接收表单
<?php
//$name=$HTTP_POST_VARS["txt_fname"];
$name=$_POST['txt_fname'];
echo $name;
?>
------------------------------------
不好意思,时间紧急,不知道行不行?
我试了试不能提交的原因是因为name中不能有下划线即改为<input type="text" name="txtfname" >$name=$_POST[ "txtfname "];
print($name);
即可