php列表显,[PHP与MySQL]①①--前台部分 列表显示

d96fdb186345

Paste_Image.png

d96fdb186345

Paste_Image.png

article.list.php

require_once('connect.php');

$sql = "select * from article order by dateline desc";

$query = mysql_query($sql);

if($query&&mysql_num_rows($query)){

while($row = mysql_fetch_assoc($query)){

$data[] = $row;

}

}

?>

文章发布系统

if(empty($data)){

echo "当前没有文章,请管理员在后台添加文章";

}else{

foreach($data as $value){

?>

<?php echo $value['title']?>  作者:<?php echo $value['author']?>

}

}

?>

default.css

/*

Design by Free CSS Templates

http://www.freecsstemplates.org

Released for free under a Creative Commons Attribution 2.5 License

*/

body {

margin: 0;

padding: 0;

background: #FFFFFF;

font-family: Arial, Helvetica, sans-serif;

font-size: 13px;

color: #6D6D6D;

}

h1, h2, h3 {

margin: 0;

text-transform: lowercase;

font-weight: normal;

color: #78CC00;

}

h1 {

letter-spacing: -1px;

font-size: 32px;

}

h2 {

font-size: 23px;

}

p, ul, ol {

margin: 0 0 2em 0;

text-align: justify;

line-height: 26px;

}

a:link {

color: #7AD000;

}

a:hover, a:active {

text-decoration: none;

color: #7AD000;

}

a:visited {

color: #7AD000;

}

img {

border: none;

}

img.left {

float: left;

margin: 7px 15px 0 0;

}

img.right {

float: right;

margin: 7px 0 0 15px;

}

/* Form */

form {

margin: 0;

padding: 0;

}

fieldset {

margin: 0;

padding: 0;

border: none;

}

legend {

display: none;

}

input, textarea, select {

font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;

font-size: 13px;

color: #333333;

}

#wrapper {

background: #7ACF00 url(images/img03.jpg);

}

/* Header */

#header {

width: 900px;

height: 80px;

margin: 0 auto 20px auto;

padding-top: 10px;

}

#logo {

float: left;

height: 120px;

margin-left: 30px;

}

#logo h1 {

font-size: 38px;

color: #3399CC;

}

#logo h1 sup {

vertical-align: text-top;

font-size: 24px;

}

#logo h1 a {

color: #FFFFFF;

}

#logo h2 {

text-transform: uppercase;

font-family: Arial, Helvetica, sans-serif;

font-size: 10px;

color: #FFFFFF;

}

#logo a {

text-decoration: none;

color: #FFFFFF;

}

/* Menu */

#menu {

float: right;

}

#menu ul {

margin: 0;

padding: 28px 0 0 0;

list-style: none;

}

#menu li {

display: inline;

}

#menu a {

display: block;

float: left;

margin-left: 5px;

background: #6AB000;

padding: 7px 10px;

text-decoration: none;

font-size: 15px;

color: #FFFFFF;

}

#menu a:hover {

text-decoration: underline;

}

#menu .active a {

}

/* Page */

#page {

width: 900px;

margin: 0 auto;

padding: 20px 20px;

}

/* Content */

#content {

float: left;

width: 590px;

padding: 0px 30px 0px 30px;

}

/* Post */

.post {

}

.post .title {

margin-bottom: 20px;

padding-bottom: 5px;

border-bottom: 10px solid #EDEDED;

}

.post .entry {

}

.post .meta {

margin: 0;

padding: 0 0 60px 0;

background: url(images/img04.jpg) repeat-x left 30%;

}

.post .meta p {

margin: 0;

line-height: normal;

}

.post .meta .byline {

float: left;

color: #0000FF;

}

.post .meta .links {

float: left;

}

.post .meta .more {

width: 185px;

height: 35px;

padding: 5px 0px 5px 0px;

text-transform: uppercase;

text-decoration: none;

font-size: 11px;

}

.post .meta .comments {

padding: 5px 0px 5px 0px;

text-transform: uppercase;

text-decoration: none;

font-size: 11px;

}

.post .meta b {

display: none;

}

/* Sidebar */

#sidebar {

float: right;

width: 230px;

}

#sidebar ul {

margin: 0;

padding: 10px 0 0 0;

list-style: none;

}

#sidebar li {

margin-bottom: 40px;

}

#sidebar li ul {

}

#sidebar li li {

margin: 0;

padding: 3px 0;

border-bottom: 1px dashed #D1D1D1;

}

#sidebar li li a {

margin: 0;

padding-left: 25px;

background: url(images/img01.png) no-repeat left 50%;

}

#sidebar h2 {

margin-bottom: 10px;

padding-bottom: 5px;

border-bottom: 10px solid #EDEDED;

font-size: 18px;

font-weight: normal;

}

#sidebar a {

text-decoration: none;

color: #6D6D6D;

}

/* Search */

#search {

}

#search h2 {

margin-bottom: 20px;

}

#s {

width: 150px;

margin-right: 5px;

padding: 3px;

border: 1px solid #F0F0F0;

}

#x {

padding: 3px;

background: #ECECEC url(images/img08.gif) repeat-x left bottom;

border: none;

text-transform: lowercase;

font-size: 11px;

color: #4F4F4F;

}

/* Boxes */

.box1 {

padding: 20px;

background: url(images/img05.gif) no-repeat;

}

.box2 {

color: #BABABA;

}

.box2 h2 {

margin-bottom: 15px;

background: url(images/img10.gif) repeat-x left bottom;

font-size: 16px;

color: #FFFFFF;

}

.box2 ul {

margin: 0;

padding: 0;

list-style: none;

}

.box2 a:link, .box2 a:hover, .box2 a:active, .box2 a:visited {

color: #EDEDED;

}

/* Footer */

#footer {

height: 400px;

min-height: 74px;

padding: 10px 0 0 0;

background: #979797 url(images/img02.jpg) repeat-x left top;

font-family: Tahoma, Arial, Helvetica, sans-serif;

}

html>body #footer {

height: auto;

}

#legal {

clear: both;

padding-top: 20px;

text-align: center;

text-transform: uppercase;

font-size: 10px;

color: #353535;

}

#legal a {

font-weight: bold;

color: #FFFFFF;

}

d96fdb186345

Paste_Image.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值