<html><body><?phpif ($submit) {  
  // 处理表格输入  while (list($name, $value) = each($HTTP_POST_VARS)) {    echo "$name = $value<br>\n";  }} else{  
  // 显示表格  ?>  <form method="post" action="<?php echo $PATH_INFO?>">  名:<input type="Text" name="first"><br>  姓:<input type="Text" name="last"><br>  住址:<input type="Text" name="address"><br>  职位:<input type="Text" name="position"><br>  <input type="Submit" name="submit" value="输入信息">  </form>  <?php} // end if,if结束?></body></html>代码如上,问题是if ($submit)这里,永远都收不到值,就是$submit永远是空的,谁能告诉我为啥哎~

解决方案 »

  1.   


    谢谢你哈
    能不能说详细一点点,
    因为不止这里,还有传id等其他的地方~哎那样我用if($id)这些还是会不行哎
      

  2.   

    submit是个提交按钮,不是值,楼主可以用个type="hidden"的input藏一个name="submit"的变量。
      

  3.   

    如果没有特别设置,通常get方式url传递的数据从$_GET数组里取。如果是表单post提交的数据从$_POST数组中取