门户网站
1、首页展示图:
1.2、部分代码展示:
1.2.1、首页头文件代码:
<header style=" width:100%; background-color:#024585; color:#fff;">
<section style="width:100%; height:32px; background:#002b54; min-width:1200px;">
<section style="width:1200px; margin:auto; min-width: 320px;">
<ul id="subNav" class="subnavLeft">
</ul>
<ul class="subNavRight">
<li id="parents">
<form action="search.php" method="post" style="margin: 0 auto;position: relative;top: -19px;" >
<input class="inputStyle" type="text" placeholder="请输入关键字" name="name" >
<input class="inputStyle" type="submit" value=" 搜索 ">
</form></a></li>
</ul>
</section>
</section>
<div style="width: 1200px; height:80px; margin: 0 auto;padding:20px 0 20px 0;min-width:1200px">
<div style="width: 348px;float: left;">
<a href="">
<img id="logo" src="images/main_03-8.png" width="348" height="80"
style="position: absolute;left: 35.34%;top: 8%;">
</a>
</div>
</div>
<div class="nav" style="width: 100%;"><!-- 使用php判断用户是否登录-->
<?php if($_SESSION['adminuser']!=""){ ?><!--adminuser是账号用户名-->
<ul style="position: fixed;top: 0px;width: 100%;
background-color: #a3abcb;">
<li><a href="index.php">首 页</a></li>
<li><a href="news.php">新闻</a></li
<li><a href="gonggao.php">公告</a></li>
<li><a href="huodong.php">活动</a></li>
<li><a href="about.php">关于本站</a></li>
<li><a href="user.php"><?php echo $_SESSION['adminuser'];?>已登陆</a></li><li>
<a href="quit.php">退出</a></li></ul>
<?php }else
{
?>
<ul style="position: fixed;top: 0px;width: 100%;
background-color: #a3abcb;">
<li><a href="index.php">首 页</a></li>
<li><a href="news.php">新闻</a></li>
<li><a href="gonggao.php">公告</a></li>
<li><a href="huodong.php">活动</a></li>
<li><a href="about.php">关于本站</a></li>
<li><a href="res.php">注册</a></li>
<li><a href="login.php">登录</a></li>
<?php
}
?>
</ul>
</div>
</header>
2、登录注册页展示图:
2.1、登录页展示图:
2.1.1、登录页代码:
<?php
include("banner.php");
session_start();
header("Content-type: text/html; charset=utf-8");
ini_set('error_reporting', 'E_ALL ^ E_NOTICE');
require_once 'conn.php';
if(isset($_POST['submit'])){
$name=$_POST['username'];
$password=$_POST['password'];
$sql="select * from user where name='$name'";
$result = mysql_fetch_array($sql);
$re=mysql_fetch_assoc(mysql_query($sql));
if(empty($re)){
echo"<script>alert('用户名错误')</script>";
echo "<script>history.back()</script>";
}else{
if($re['password']!=$password){
echo"<script>alert('密码错误')</script>";
echo "<script>history.back()</script>";
}else{
$_SESSION['adminuser'] = $name;
echo"<script>alert('登录成功')</script>";
echo "<script>location.href='../index.php'</script>";
}
}
} ?>
<link rel="stylesheet" type="text/css" href="./css/login.css"/>
<link rel="stylesheet" href="css/search.css"><!-- 搜索框样式 -->
<link rel="stylesheet" type="text/css" href="css/zzsc.jpg.css">
<title>登录</title><meta name="keywords">
<?php include "loginheader.php"; ?>
<div class="loginbox">
<div class="menu"><h2 style="color:black;text-align:center;">登录</h2></div>
<br />
<div class="login" >
<form action="" method="post" name="send" onSubmit="return Check()" style="margin: 0 auto;">
<ul>
<li><span style="width: 360px">用户名:</span>
<input name="username" placeholder="请输入用户名" type="text" />
</li>
<li><span style="width: 360px">密码:</span>
<input name="password" placeholder="请输入密码" type="password" />
</li>
<br>
<span class="regiserbutton">
<a href="register.php">
<input class="loginbutton registerbutton1"
name="submit" type="button" value="跳转到注册"></a>
<input class="loginbutton loginbutton1"
name="submit" type="submit" value="登录" />
</span>
<span class="adminbutton">
<button class="loginbutton adminbutton1"><a href="./admin/index.php">管理员登录入口</a></button>
</span>
</ul>
</form>
</div>
</div>
<?php include "footer.php"; ?>
2.1.1、登录页css样式:
.loginbox {
position: relative;
top: -90px;
text-align: center;
margin: 0 auto;
width: 976px;
margin: 0 auto;
}
/*跳转到注册按钮样式*/
.regiserbutton{
position: absolute;
bottom: -85px;
left: 37.87%;
}
/*跳转到注册 输入按钮样式*/
.regiserbutton input{
color: #fff;
width:132px;
height: 50px;
line-height: 0;
}
/* 管理员登录入口按钮样式 */
.adminbutton{
position: absolute;
bottom: -150px;
left: 47.3%;
}
/* 跳转到注册按钮样式 */
.loginbutton {
background-color: #4CAF50; /* Green */
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
-webkit-transition-duration: 0.4s; /* Safari */
transition-duration: 0.4s;
}
.registerbutton1:hover {
box-shadow: 0 12px 16px 0 rgba(0,0,0,0.24),0 17px 50px 0 rgba(0,0,0,0.19);
}
.loginbutton1:hover {
box-shadow: 0 12px 16px 0 rgba(0,0,0,0.24),0 17px 50px 0 rgba(0,0,0,0.19);
}
.adminbutton1 a{
color: #fff;
}
.adminbutton1:hover {
box-shadow: 0 12px 16px 0 rgba(0,0,0,0.24),0 17px 50px 0 rgba(0,0,0,0.19);
}
2.2、注册页展示图:
私信我或者在下方评论,说出你的需求,后续我会发出。
代码还没有整理好,后续会打包压缩,上传到资源。
后续会添加其他样式和功能,尽我所能完善用户要求。
欢迎各位大佬的到来,请多多指教。我是菜鸟,喜欢就好。