<input name="student" type = submit>   <input name="admin" type = submit>
if($_POST['student'])
{
  connection student;
}else
{
  connection admin;
}

解决方案 »

  1.   

    多谢楼上指点.对于大致步骤我了解,但对php编码连接部分却有点儿犯晕.<li>
    <label>用户名:</label><input name="TextBox1" type="text" id="TextBox1" tabindex="1" class="text_nor" />
    </li><li>
    <label>密 &nbsp; 码:</label><input name="TextBox2" type="password" id="TextBox2" tabindex="2" class="text_nor" />
    </li><li>
    <table id="RadioButtonList1" border="0" width="100%">
    <tr>
    <td>
    <input id="RadioButtonList1_1" type="radio" name="RadioButtonList1" value="教师" tabindex="3" /><label for="RadioButtonList1_1">教师</label>
    </td>
    <td>
    <input id="RadioButtonList1_2" type="radio" name="RadioButtonList1" value="学生" checked="checked" tabindex="3" /><label for="RadioButtonList1_2">学生</label>
    </td>
    </tr>
    </table>
    </li><li>
    <input type="submit" name="Button1" value="" id="Button1" class="btn_dl" /><input type="submit" name="Button2" value="" id="Button2" class="btn_cz" onclick="window.close();" />
    </li>
      

  2.   

    if($_POST['Button1']&&$_POST['RadioButtonList1'] == "学生") //最好value设置为数字

      connection student; 
    }else 

      connection admin; 
    }
      

  3.   

    楼上的这个问题用搞两个提交按钮吗??
    <form action="handle.php" method="post">
    <input type="radio" value="1" name="person"/>学生
    <input type="radio" value="2" name="person"/>管理员
    <input type="submit" value="提交" />
    </form>
    handle.php程序这样判断
    if($_POST[submit]){
    switch($_POST[person]){
    case '1':
    include("student_login.php");
    break;
    case '2':
    include("admin_login.php");
    break;
    default:
    break;
    }
    }