简易php博客(3)_后台登陆

login.php




简易blog后台测试



HTML;

session_start();
$_SESSION['mng_name']="";
$_SESSION['mng_tag']="";
if(!empty($_POST['login'])){
        $login=$_POST['login'];
        if ($login=="登 陆"){
            $username=$_POST['username'];
            $password=$_POST['password'];
            if ($username!="" and $password!=""){
                $query="select * from manage where usr='$username'";
                @$query = mysql_query($query)or die("查询数据表失败");
                $user=mysql_fetch_array($query);
                if ($user['pwd']==$password){
                    $_SESSION['mng_name']=$user['usr'];
                    $_SESSION['mng_tag']=1;
                    header("location:./index.php");
					exit;
                }else{
                    echo"登陆失败";
                }
            }
        }
    }

echo <<

简易blog后台管理系统

账号:

口令:

    

 >>>index<<<
HTML; ?>效果:

简易php博客(3)_后台登陆_第1张图片

你可能感兴趣的:(web)