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
答案:if($_POST["RadioGroup1"=="学生登录"]{
你的]放错位置了 后面好多类似错误
if($_POST["RadioGroup1"]=="学生登录"){
其他:提示什么错误?
上一个:有经验的php程序员进!
下一个:php怎么把数组中相同的多个元素合并为一个元素