【php】6、学生管理系统-登陆进去

<?php
    include_once '../mysql.class.php';
    include_once '../confing.php';
    include_once 'adminService.class.php';
    //吧用户登陆放到session中,一直检测
//     session_start();

    if(!isset($_POST['name']) || !isset($_POST['password']))
    {
        echo "少年!请先<a href='index.html'>登陆</a>!";
        exit();
    }
    else
    {
        $name = $_POST['name'];
        $password = $_POST['password'];
        $adminservice1 = new adminservice();
        if(($adminservice1->checkstunum($name, $password)) > 0)
        {
            session_start();
            $url = "adminmanage.php";
            $_SESSION['admin_name'] = $name;
            echo $_SESSION['admin_name'];
            echo "<script type='text/javascript'>"."location.href='".$url."'"."</script>";
        }
        else
        {
            //登陆失败
            header("refresh:5;url=admin_login.php");
            print('正在加载,请稍等...<br>五秒后自动跳转到管理界面~~~');
        }
    }
?>


登陆成功:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>学生成绩管理系统</title>
	</head>
	
	<body background="../pic/bg.gif">
		<table width="767" height="644" border="0" align="center">
			<tr>
                <td height="228" colspan="5" background="../pic/top.gif">    </td>
            </tr>
            <tr>
              <td height="22" colspan="5" background="../pic/in_01.gif"></td>
            </tr>
		    <tr>
		     <td background="../pic/in_20.gif" ><a href="adminstudentlist.php">查看用户</a></td>
		     <td background="../pic/in_20.gif" ><a href="updateAdminInfo.php">修改个人信息</a></td>
		     <td background="../pic/in_20.gif" ><a href="adminlist.php">查看管理员</a></td>
		     <td background="../pic/in_20.gif" ><a href="Http://localhost/studentManage/index.html">用户登陆</a></td>
		     <td background="../pic/in_20.gif" ><a href="index.html">退出系统</a></td>
		    </tr>
	    </table>
    </body>
</html>

预览:

失败:







  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值