php网页不知道错误在哪
<?phpif($_POST["RadioGroup1"=="学生登录"]{if($_POST["name"]){require"public.php";mysql_qu...
<?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>"
}
}
}
?> 展开
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>"
}
}
}
?> 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询