Create two forms, one for teacher, and one for student. In both, include the following dropdown menu:
<select onchange="MM_jumpMenu('parent',this,0)">
<option value="">Please select student or teacher..</option>
<option value="teacher.php">Teacher</option>
<option value="student.php">Student</option>
</select>
Include this javascript function in the head:
<script type="text/javascript">
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location=\'"+selObj.options[selObj.selectedIndex].value+"\'");
if (restore) selObj.selectedIndex=0;
}
</script>
The function will cause the forms to toggle, depending on which option is selected in the dropdown. There are many ways of doing this, but this seems easiest to me.