
网站但是我还是会一小点的,不懂代码,不知道这个是什么问题,后台登陆是这样的,也登录不了
common.php
<?php
@header("content-Type: text/html; charset=utf-8");
date_default_timezone_set('Asia/Shanghai');
date_default_timezone_set('PRC');
error_reporting(E_ALL & ~E_NOTICE);
session_start();
//if(defined('IN_CRONLITE'))return;
define('SYSTEM_ROOT', dirname(__FILE__).'/');
define('ROOT', dirname(SYSTEM_ROOT).'/');
define('TEMPLATE_ROOT', ROOT.'Template/');
define('PAYTEMPLATE_ROOT', ROOT.'Submit/Template/');
if (phpversion() < '5.6') {
exit('<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>站点提示信息</title>
<style type="text/css">
html{background:#eee}body{background:#fff;color:#333;font-family:"微软雅黑","Microsoft YaHei",sans-serif;margin:2em auto;padding:1em 2em;max-width:700px;-webkit-box-shadow:10px 10px 10px rgba(0,0,0,.13);box-shadow:10px 10px 10px rgba(0,0,0,.13);opacity:.8}h1{border-bottom:1px solid #dadada;clear:both;color:#666;font:24px "微软雅黑","Microsoft YaHei",,sans-serif;margin:30px 0 0 0;padding:0;padding-bottom:7px}#error-page{margin-top:50px}h3{text-align:center}#error-page p{font-size:9px;line-height:1.5;margin:25px 0 20px}#error-page code{font-family:Consolas,Monaco,monospace}ul li{margin-bottom:10px;font-size:9px}a{color:#21759B;text-decoration:none;margin-top:-10px}a:hover{color:#D54E21}.button{background:#f7f7f7;border:1px solid #ccc;color:#555;display:inline-block;text-decoration:none;font-size:9px;line-height:26px;height:28px;margin:0;padding:0 10px 1px;cursor:pointer;-webkit-border-radius:3px;-webkit-appearance:none;border-radius:3px;white-space:nowrap;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-box-shadow:inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08);box-shadow:inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08);vertical-align:top}.button.button-large{height:29px;line-height:28px;padding:0 12px}.button:focus,.button:hover{background:#fafafa;border-color:#999;color:#222}.button:focus{-webkit-box-shadow:1px 1px 1px rgba(0,0,0,.2);box-shadow:1px 1px 1px rgba(0,0,0,.2)}.button:active{background:#eee;border-color:#999;color:#333;-webkit-box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5);box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5)}table{table-layout:auto;border:1px solid #333;empty-cells:show;border-collapse:collapse}th{padding:4px;border:1px solid #333;overflow:hidden;color:#333;background:#eee}td{padding:4px;border:1px solid #333;overflow:hidden;color:#333}
</style>
</head>
<body id="error-page">
<h3>站点提示信息</h3>
当前PHP版本('.phpversion().'),请切换到5.6以上方可使用!
</body>
</html>');
}
include("config.php");
include("authcode.php");
try {
$hsot=$dbconfig['hsot'];
$dbname=$dbconfig['dbname'];
$dbh = new PDO("mysql:host=$hsot;dbname=$dbname", $dbconfig['user'], $dbconfig['pwd']);
} catch (PDOException $e) {
//exit(json_encode(array('code'=>404,'msg'=>'链接数据库失败:'.$e->getMessage())));
exit('链接数据库失败:'.$e->getMessage());
}
require_once("sendmail.php");
require_once("obtanin.php");
/**
*邮件调用代码
*if (send_mali("3585812979@qq.com","标题","<p>内容</p>")) {
* echo "成功";
*} else {
* echo "失败";
*}
**/
?>
login.php
<?php
include("../core/login.php");
if (isset($_GET['logout'])) {
setcookie("admin","",time()-604800);
exit("<script language='javascript'>alert('你已注销本次登录');window.location.href='./login.php';</script>");
}elseif ($is_admin==1) {
exit("<script language='javascript'>alert('你已登录');window.location.href='./';</script>");
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>后台登录</title>
<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="../css/login.css">
<link rel="stylesheet" href="../css/bootstrap.min.css">
</head>
<body>
<!-- 模态框 -->
<div class="modal fade" id="myModal">
<div class="modal-dialog">
<div class="modal-content">
<!-- 模态框头部 -->
<div class="modal-header">
<h4 class="modal-title" id="title">加载中</h4>
<button type="button" class="close" data-dismiss="modal">×</button>
</div>
<!-- 模态框主体 -->
<div class="modal-body">
<div style="display: flex; justify-content: center;" id="gif"><img src="../img/Loading.gif" alt="" width="200px" height="200px"></div>
<p id="text"></p>
</div>
<!-- 模态框底部 -->
<div class="modal-footer" style="display: none;" id="bottom">
<button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="btnan">确定</button>
</div>
</div>
</div>
</div>
<section class="back">
<div class="imgbox"><img src="../img/404.svg" alt=""></div>
<form action="form">
<h2>登录后台</h2>
<input type="text" name="user" id="user" placeholder="请输入账号">
<input type="password" name="pass" id="pass" placeholder="请输入密码">
<p id="login">登录</p>
</form>
</section>
<script src="../js/jquery-3.6.0.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script>
$(document).ready(function(){
$("#login").click(function(){
$("#myModal").modal("show");
$("#title").text("加载中");
$("#gif").css("display","flex");
$("#text").text("");
$("#bottom").css("display","none");
var user=$("#user").val();
var pass=$("#pass").val();
$.ajax({
type: "POST",
url: "ajax.php?act=login",
data: {"user":user,"pass":pass},
dataType: "json",
timeout: 15000,
success: function(data){
$("#title").text("网站提示");
$("#gif").css("display","none");
$("#text").text(data.msg);
if(data.code==1){
$("#bottom").css("display","flex");
}
},
error: function(data){
$("#title").text("网站提示");
$("#gif").css("display","none");
$("#text").text("服务器错误");
}
});
});
$("#btnan").click(function(){
$("#myModal").modal("hide");
location.href="./";
});
});
</script>
</body>
</html>