<form name=\"form1\" method=\"post\" action=\"?txtName=txt&gg={$_POST['fruit']}\">
<table width=\"51%\" height=\"176\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
      <tr>
        <td width=\"17%\" height=\"59\" align=\"right\">账号:</td>
        <td width=\"55%\" align=\"left\" valign=\"middle\">
          <label>
            <input name=\"fruit\" type=\"text\" size=\"12\"></label>我是一个页面用 switch 模式判断  为什么 POST信息不能显示在列表上,提交后是空的http://127.0.0.1/qn.php?txtName=txt&gg= {这里为什么是空的}

解决方案 »

  1.   

    把 $_POST['fruit'] 保存在一个变量试试!
      

  2.   

    switch($txtName){
      case "txt":
      txtname($_REQUEST['gg']);
      break;
       
        default:
        //txtUserName($_REQUEST['txtUserName']);
        indexx();
        break;
    }
    function indexx(){
    <form name=\"form1\" method=\"post\" action=\"?txtName=txt&gg={$_POST['fruit']}\">
        <table width=\"51%\" height=\"176\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
          <tr>
            <td width=\"17%\" height=\"59\" align=\"right\">账号:</td>
            <td width=\"55%\" align=\"left\" valign=\"middle\">
              <label>
                <input name=\"fruit\" type=\"text\" size=\"12\"></label>}代码是这样的
      

  3.   

    服务器端脚本语言和客户端html混在一起写,当然会有问题。
      

  4.   

    fruit是表单中的input,既然你以post形势提交表单,fruit自然就被提交了,为什么还要在连接上面再加参数呢?直接去掉这个参数,在提交到的页面直接用$_POST['fruit']就能获取到input fruit中的值!
      

  5.   

    你可以在使用前,var_dump($_POST['fruit']); 看看是否有这个变量值。
      

  6.   

    把action=\"?txtName=txt&gg={$_POST['fruit']}改成action=\"?txtName=txt