<html>
<body>
<?php
if(isset($HTTP_POST_VARS['submit']))
{
   while(list($name, $value)=each($HTTP_POST_VARS)) 
         echo "$name = $value\n";
}
else
{
?>
   <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
   名: <input type="Text" name="first"></input>
   姓: <input type="Text" name="last"></input>
   住址:<input type="Text" name="address"></input>
   职位:<input type="Text" name="position"></input>
   <input type="Submit" name="submit" value="输入信息"></input>
   </form>
<?php
}
?>
</body>
</html>

解决方案 »

  1.   

    修改部分
    1:在处理变量时先检查一下是否存在(isset($HTTP_POST_VARS['submit']))
    2:php本身页面的表示 $_SERVER['PHP_SELF']
      

  2.   

    完全正确!不过,PHP_INFO与PHP_SELF是一样的
      

  3.   

    不是吧,在我机器上用PHP_INFO提示未定义
      

  4.   

    我找PHP手册也没找到PHP_INFO的相关资料
    不知道你是从哪里看来的