当前位置:编程学习 > php >>

php网页不知道错误在哪

<?php if($_POST["RadioGroup1"=="学生登录"]{ if($_POST["name"]){ require"public.php"; mysql_query("SET NAMES GB2312"); $name=$_REQUEST["name"]; $pass=$_REQUEST["password"]; $sql"select * from $tb_std where studentID='$name'&& password='$pass'"; $result=mysql_query($sql); if(mysql_num_rows($result)!=0){ setcoocie("admin","$name",time()+60*5); echo"<html><head><meta http-equiv='Content-Type' content='text/html; charset=gb2312' />"; echo"<meta http-equiv='refresh' content='1; url= '>"; echo"</head>"; echo"<body>登录成功!1秒后进入学生界面......</body>" echo"</html>" } else{ echo"<center>用户名或密码错误!</center>" } } } elseif($_POST["RadioGroup1"=="教师登录"]{ if($_POST["name"]){ require"public.php"; mysql_query("SET NAMES GB2312"); $name=$_REQUEST["name"]; $pass=$_REQUEST["password"]; $sql"select * from $tb_tch where teacherID='$name'&& password='$pass'"; $result=mysql_query($sql); if(mysql_num_rows($result)!=0){ setcoocie("admin","$name",time()+60*5); echo"<html><head><meta http-equiv='Content-Type' content='text/html; charset=gb2312' />"; echo"<meta http-equiv='refresh' content='1; url=Teacher_User.php'>"; echo"</head>"; echo"<body>登录成功!1秒后进入教师界面......</body>" echo"</html>" } else{ echo"<center>用户名或密码错误!</center>" } } } elseif($_POST["RadioGroup1"=="管理员登录"]{ if($_POST["name"]){ require"public.php"; mysql_query("SET NAMES GB2312"); $name=$_REQUEST["name"]; $pass=$_REQUEST["password"]; $sql"select * from $tb_admin where adminId='$name'&& password='$pass'"; $result=mysql_query($sql); if(mysql_num_rows($result)!=0){ setcoocie("admin","$name",time()+60*5); echo"<html><head><meta http-equiv='Content-Type' content='text/html; charset=gb2312' />"; echo"<meta http-equiv='refresh' content='1; url= '>"; echo"</head>"; echo"<body>登录成功!1秒后进入管理员界面......</body>" echo"</html>" } else{ echo"<center>用户名或密码错误!</center>" } } } ?>
追问:再帮忙看看   他说第8行还有错误你在帮我看看   老是不行啊   麻烦你了
Notice: Undefined offset: 0 in F:\xampp\htdocs\StudentMessage\Login_In.php on line 2

Notice: Undefined offset: 0 in F:\xampp\htdocs\StudentMessage\Login_In.php on line 23

Notice: Undefined offset: 0 in F:\xampp\htdocs\StudentMessage\Login_In.php on line 44
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,