/
newstype.php
54 lines (41 loc) · 1.4 KB
/
newstype.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
header("content-type:text/html;charset=utf-8");
include_once 'dbio/NewsTypes.php';
include_once 'dbio/NewsArticles.php';
//获得url中的参数
$typeId = $_GET["typeId"];
$newsTypes = NewsTypes::getNewsTypes();//所有分类
$newsInfo = NewsArticles::getNewsByTypeId($typeId);//当前分类的所有新闻
$newsType = NewsTypes::getNewsTypeById($typeId);//当前分类的详细信息
?>
<html>
<head>
<title>天天新闻网</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<link href="css/news.css" type="text/css" rel="stylesheet" />
</head>
<body>
<!-- 网站头 -->
<?php include_once 'header.php';?>
<!-- 正文内容 -->
<div class="mainDiv clear">
<div class="newsTypeDiv">
<div class="newsTypeDiv1"> <a href="index.php" class="a">新闻主页</a> » <?php echo $newsType["typeName"]?></div>
<div class="newsTypeDiv2">本类共有 <?php echo $newsType["articleNums"]?> 条新闻</div>
</div>
<?php
foreach ($newsInfo as $v)
{
?>
<div class="newsTypeDiv3">
<img src="images/makealltop.gif"><a href="news.php?articleId=<?php echo $v["articleId"]?>"><?php echo $v["title"]?></a>
</div>
<?php
}
?>
<div class="newsTypeDiv3"> </div>
</div>
<!-- 网页脚 -->
<?php include_once 'footer.php';?>
</body>
</html>