<input name="student" type = submit> <input name="admin" type = submit>
if($_POST['student'])
{
connection student;
}else
{
connection admin;
}
if($_POST['student'])
{
connection student;
}else
{
connection admin;
}
<label>用户名:</label><input name="TextBox1" type="text" id="TextBox1" tabindex="1" class="text_nor" />
</li><li>
<label>密 码:</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>
{
connection student;
}else
{
connection admin;
}
<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;
}
}