php select表单提交未定义
index.php
<form method="post" action="lib\ChkLogin.php"><br /> ..............................<br /> <select name="role"><br /> <option value="student">student</option><br /> <option value="teacher">teacher</option><br /> </select><br /> </td><br /> </tr><br /> <tr><br /> <td><input type="submit" value="ok" /></td><br /> <td><input type="reset" value="no" /></td><br /> </tr><br /> <br /> </table><br /> </form>
<?php<br />$username = $_POST['username'];<br />$passwd = $_POST['passwd'];<br />$role = $_POST['role'];<br />if($username==""||$passwd==""){<br /> echo "<script>";<br /> echo "alert(\"用户名或密码不能为空!\");";<br /> echo "location.href=\"../index.php\";";<br /> echo "</script>";<br /> }<br /> ......................<br />