首页 > 代码库 > php开发博客

php开发博客

 1 <!doctype> 2 <html> 3 <head> 4 <meta charset="gbk"> 5 <title>首页——博客</title> 6 <link type="text/css" href="http://www.mamicode.com/css/style.css" rel="stylesheet"> 7 <?php 8 //引入文件 9   require_once ‘db.php‘;10   include_once‘./inc/header.php‘;11   ?>12 </head>13 <body>14 <?php 15   $query = "select * from `arts` order by id DESC limit 0,10";  //获取最近十篇内容16   $res=mysql_query($query);17   while ($row=mysql_fetch_array($res)){ //循环开始18 ?>19 <div class="nav_new">20   <ul>21     <li><a href="http://www.mamicode.com/view.php?id=<?php echo $row[‘id‘]?>" target="_blank"><?php echo $row[‘title‘]?></a></li>22   </ul>  23 </div>   24 <?php 25 }26 ?>27 </body>28 <?php include_once‘./inc/footer.php‘?>29 </html>

首页代码~

php开发博客