<?php //引入文件 require_once 'db.php'; include_once'./inc/header.php'; ?> </head> <body> <?php $query = "select * from `arts` order by id DESC limit 0,10"; //获取最近十篇内容 $res=mysql_query($query); while ($row=mysql_fetch_array($res)){ //循环开始 ?> <div class="nav_new"> <ul> <li><a href="view.php?id=<?php echo $row['id']?>" target="_blank"><?php echo $row['title']?></a></li> </ul> </div> <?php } ?>