本文链接:https://www.dnwfb.com/1525.html,转载请注明出处。<?php
$adminkey = "admin"; /*—————–请在上面修改登陆密码,默认密码是admin—————- */
session_start();
if(@$_POST['password'] == $adminkey){
$_SESSION['login'] = md5($adminkey);
?>
登陆成功
<a href="?logout" style="color: red;">退出登录</a>
<?}
//if($_SERVER['QUERY_STRING'] == "logout"){
// $_SESSION['login'] = "";
//header("location: " . $_SERVER['PHP_SELF']); exit();
else{
?>
<!DOCTYPE html>
<html>
<head>
<title>登录</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style>
div{text-align:center; margin:0 auto;}
#loginform{width:350px;height:100px;background-color:#F8F8FF;box-shadow: 1px 1px 1px 1px #888888;}
</style>
</head>
<body>
<div id="loginform">
<div style="text-align:center; margin:30px auto 0px;">
<form action="" method="post"> 独立查看密码
<input type="password" name="password" style="width:120px; margin-top: 35px;">
<input type="submit" value="登录" style="margin-left: 5px;">
</form>
</div>
</div>
</body>
</html>
<?}?>
评论0