时间:2021-07-01 10:21:17 帮助过:7人阅读
分享到:
学生注册
//######################学生注册##########################
include "config.php";
include "header.php";?>
if ($xuehao=="" ||$name=="" || $class=="" ||$password=="" ||$password1=="" ||$telephone=="")
{
echo"请把信息添写完整
";
echo "";
exit;
}
$query="select * from $student_infor where no='$xuehao' and name='$name'";
mysql_query("set names 'GB2312'");
$result=mysql_query($query);
$row=mysql_fetch_array($result);
if($row==0)
{
echo"你输入的信息有误,不属于计算机学院毕业生!
";
echo "";
exit;
}
$query="select * from $student_table where xuehao='$xuehao'";
mysql_query("set names 'GB2312'");
$result=mysql_query($query);
$row=mysql_fetch_array($result);
if($row!=0)
{
echo"此学号已注册,请重新填写!
";
echo "";
exit;
}
if($password!=$password1)
{
echo"输入的密码不一致,请重新输入!
";
echo "";
exit;
}
$query="insert into $student_table values('$xuehao','$name','$sex','$class','$password','$love','$telephone','$reward','')";
mysql_query("set names 'GB2312'");
$result=mysql_query($query);
if($result==true){
echo "注册成功!
";
echo "";
exit;
}
?>