php+html写的登录界面点了登录没有反应

下面是代码,求大神帮忙看看
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>学生学籍成绩管理系统</title>
</head>
<script language="JavaScript">
if(window.top.location.href!=window.location.href)
{
window.top.location.href=window.location.href;
}
</script>
<body>
<form action="" method="post">
<table width="35%" border="1" align="center" cellspacing="0" bordercolor="#328EBE">
<tr>
<td align="center" valign="middle" bgcolor="#328EBE"><h2>学生学籍成绩管理系统</h2></td>
</tr>
<tr>
<td height="133">
<table width="328" border="0" align="center">
<tr>
<td width="98" height="30" align="center">用户名:</td>
<td width="230" height="30"><input type="text" name="userid" size="26" placeholder="学号/工号"/></td>
</tr>
<tr>
<td height="30" align="center">密码:</td>
<td height="30"><input type="password" name="password" size="26" placeholder="密码"/></td>
</tr>
<tr>
<td height="30" colspan="2" align="center">
<input type="radio" name="role" value="admin" checked="checked"/>管理员
<input type="radio" name="role" value="teacher"/>任课教师
<input type="radio" name="role" value="student"/>学生
</td>
</tr>
<tr>
<td height="30" colspan="2" align="center"><input type="submit" name="login" value="登录"/></td>
</tr>
</table>
</td>
</tr>
</table>
</form>

<?php
echo"<script> alert('用户名或密码错');</script>";//加这一行没反应!
echo 'test1';/////////////这一行也没有现象!
session_start();
session_destroy();
include "Fun.php";
if(isset($_POST["login"]))
{
$role=$_POST["role"];
$userid=trim($_POST["userid"]);
$pwd=trim($_POST["password"]);
$sql="select * from $role where ".$role."id='$userid'and pwd='$pwd'";
$result=mysql_query($sql);
$row=mysql_fetch_array($result);
if($row)
{//若登陆成功则把用户类别及用户名写入session
$_SESSION['role']=$role;
$_SESSION['userid']=$userid;
echo"<script>location.href='Index.php';</script>";
}
else
{
echo"<script> alert('用户名或密码错');location.href='Login.php';</script>";
}
}
?>
</body>
</html>

你好,我这边显示是正常的,是不是你的php环境有问题???

温馨提示:答案为网友推荐,仅供参考
相似回答